Documentation

SurveyJSParser

Table of Contents

Interfaces

ElementParserInterface
FlattenResponseInterface
BaseValueInterface
This models the smallest piece of data.
BooleanValueInterface
This models the smallest piece of data.
ClosedVariableInterface
DateTimeValueInterface
This models the smallest piece of data.
IntegerValueInterface
This models the smallest piece of data.
IntegerValueOptionInterface
This models the smallest piece of data.
IntegerVariableInterface
MultipleChoiceVariableInterface
RecordInterface
SpecialValueInterface
This models the smallest piece of data.
SpecialValueOptionInterface
This models the smallest piece of data.
StoredRecordInterface
StringValueInterface
This models the smallest piece of data.
StringVariableInterface
TimestampVariableInterface
ValueMapInterface
Models a value that contains key value pairs.
ValueOptionInterface
This models the smallest piece of data.
VariableSetInterface
VariableTitleFormatterInterface
LocalizerInterface
SurveyParserInterface

Classes

ArrayDataRecord
ArrayRecord
A simple array wrapper that implements `RecordInterface`
NotClosedException
NotMultiValuedException
NotNormalException
ParseError
ArrayNode
BinaryOperatorNode
Buffer
FunctionNode
Node
UnaryOperatorNode
UnescapedStringNode
ValueNode
VariableNode
DataTypeHelper
ExpressionParser
FlattenResponseHelper
OptionGenerator
ParserLocalizer
BooleanParser
CallbackElementParser
An element parser that uses a closure to parse any given question configuration.
CommentParser
DummyParser
A parser that always resolves to an empty list of variables
DynamicPanelParser
ExpressionParser
ImagePickerParser
MatrixDynamicParser
MatrixParser
MultipleChoiceMatrixParser
MultipleChoiceQuestionParser
MultipleTextParser
NoUISliderParser
OrderedVariableParser
PanelParser
RankingParser
RatingParser
SingleChoiceQuestionParser
TextQuestionParser
ResolvableVariableSet
SurveyConfiguration
Survey wide configuration settings that affect parsing of individual questions
SurveyParser
BooleanValueOption
DateTimeValue
DontKnowValueOption
FloatValue
IntegerValue
IntegerValueOption
InvalidValue
MissingValue
MultipleChoiceValue
NoneValueOption
OtherValueOption
RefuseValueOption
StringValue
StringValueOption
BooleanVariable
FloatVariable
IntegerVariable
MultipleChoiceVariable
OpenTextVariable
SingleChoiceIntegerVariable
SingleChoiceVariable
TimestampVariable
VariableSet

Traits

GetDisplayValue
GetName
GetRawConfiguration
GetTitle

Enums

Operator
Measure
ValueType

Functions

extractOptionalString()  : string|null
extractOptionalInteger()  : int|null
extractOptionalName()  : string
extractValueName()  : string
extractOptionalArray()  : array<string|int, mixed>|null
extractChoices()  : array<int, ValueOptionInterface>
We use a mixed type here; since we're parsing user data.
extractLocalizedTexts()  : array<string, string>
extractBoolean()  : bool
extractOptionalBoolean()  : bool|null
showNoneItem()  : bool
showOtherItem()  : bool
showCommentArea()  : bool
showRefuseItem()  : bool
showDontKnowItem()  : bool
generateChoices()  : array<int, ValueOptionInterface>
extractName()  : string
arrayFormat()  : array<string, string>
Concat a combination of localized strings and normal ones
extractTitles()  : array<string, string>
allInstanceOf()  : bool

Functions

extractOptionalString()

extractOptionalString(array<string|int, mixed> $config, string $key) : string|null
Parameters
$config : array<string|int, mixed>
$key : string
Return values
string|null

extractOptionalInteger()

extractOptionalInteger(array<string|int, mixed> $config, string $key) : int|null
Parameters
$config : array<string|int, mixed>
$key : string
Return values
int|null

extractOptionalName()

extractOptionalName(array<string|int, mixed> $config) : string
Parameters
$config : array<string|int, mixed>
Tags
throws
InvalidArgumentException
Return values
string

extractValueName()

extractValueName(array<string|int, mixed> $config) : string
Parameters
$config : array<string|int, mixed>
Return values
string

extractOptionalArray()

extractOptionalArray(array<string|int, mixed> $config, string $key) : array<string|int, mixed>|null
Parameters
$config : array<string|int, mixed>
$key : string
Return values
array<string|int, mixed>|null

extractChoices()

We use a mixed type here; since we're parsing user data.

extractChoices(mixed $choices) : array<int, ValueOptionInterface>

We expect / hope for a list, but might get anything.

Parameters
$choices : mixed
Return values
array<int, ValueOptionInterface>

extractLocalizedTexts()

extractLocalizedTexts(array<string|int, mixed> $config[, non-empty-string $field = 'text' ][, array<string, string> $defaults = [] ]) : array<string, string>
Parameters
$config : array<string|int, mixed>
$field : non-empty-string = 'text'
$defaults : array<string, string> = []
Return values
array<string, string>

extractBoolean()

extractBoolean(array<string|int, mixed> $config, bool $default, string ...$keys) : bool
Parameters
$config : array<string|int, mixed>
$default : bool
$keys : string
Return values
bool

extractOptionalBoolean()

extractOptionalBoolean(array<string|int, mixed> $config, string $key) : bool|null
Parameters
$config : array<string|int, mixed>
$key : string
Return values
bool|null

showNoneItem()

showNoneItem(array<string|int, mixed> $config) : bool
Parameters
$config : array<string|int, mixed>
Return values
bool

showOtherItem()

showOtherItem(array<string|int, mixed> $config) : bool
Parameters
$config : array<string|int, mixed>
Return values
bool

showCommentArea()

showCommentArea(array<string|int, mixed> $config) : bool
Parameters
$config : array<string|int, mixed>
Return values
bool

showRefuseItem()

showRefuseItem(array<string|int, mixed> $config) : bool
Parameters
$config : array<string|int, mixed>
Return values
bool

showDontKnowItem()

showDontKnowItem(array<string|int, mixed> $config) : bool
Parameters
$config : array<string|int, mixed>
Return values
bool

extractName()

extractName(array<string|int, mixed> $config) : string
Parameters
$config : array<string|int, mixed>
Tags
throws
InvalidArgumentException
Return values
string

arrayFormat()

Concat a combination of localized strings and normal ones

arrayFormat(array<string, string> $titles, array<string, string>|string ...$variables) : array<string, string>
Parameters
$titles : array<string, string>
$variables : array<string, string>|string
Return values
array<string, string>

extractTitles()

extractTitles(array<string|int, mixed> $config) : array<string, string>
Parameters
$config : array<string|int, mixed>
Return values
array<string, string>

allInstanceOf()

allInstanceOf(array<int, object> $items, T> $class) : bool
Parameters
$items : array<int, object>
$class : T>
Tags
template

T

phpstan-assert-if-true

list<T> $items

Return values
bool

        
On this page

Search results