Documentation

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|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