utils.php
Table of Contents
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|nullextractOptionalInteger()
extractOptionalInteger(array<string|int, mixed> $config, string $key) : int|null
Parameters
- $config : array<string|int, mixed>
- $key : string
Return values
int|nullextractOptionalName()
extractOptionalName(array<string|int, mixed> $config) : string
Parameters
- $config : array<string|int, mixed>
Tags
Return values
stringextractValueName()
extractValueName(array<string|int, mixed> $config) : string
Parameters
- $config : array<string|int, mixed>
Return values
stringextractOptionalArray()
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>|nullextractChoices()
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
boolextractOptionalBoolean()
extractOptionalBoolean(array<string|int, mixed> $config, string $key) : bool|null
Parameters
- $config : array<string|int, mixed>
- $key : string
Return values
bool|nullshowNoneItem()
showNoneItem(array<string|int, mixed> $config) : bool
Parameters
- $config : array<string|int, mixed>
Return values
boolshowOtherItem()
showOtherItem(array<string|int, mixed> $config) : bool
Parameters
- $config : array<string|int, mixed>
Return values
boolshowCommentArea()
showCommentArea(array<string|int, mixed> $config) : bool
Parameters
- $config : array<string|int, mixed>
Return values
boolshowRefuseItem()
showRefuseItem(array<string|int, mixed> $config) : bool
Parameters
- $config : array<string|int, mixed>
Return values
boolshowDontKnowItem()
showDontKnowItem(array<string|int, mixed> $config) : bool
Parameters
- $config : array<string|int, mixed>
Return values
boolgenerateChoices()
generateChoices(array<string|int, mixed> $questionConfig) : array<int, ValueOptionInterface>
Parameters
- $questionConfig : array<string|int, mixed>
Return values
array<int, ValueOptionInterface>extractName()
extractName(array<string|int, mixed> $config) : string
Parameters
- $config : array<string|int, mixed>
Tags
Return values
stringarrayFormat()
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>