ky_assure_array
ky_assure_bool
ky_assure_constant
ky_assure_int
ky_assure_object
ky_assure_positive_int
ky_assure_string
ky_bytes_format
ky_get_post_value
ky_get_tag_parameters
ky_seconds_format
ky_usort_comparison
ky_xml_to_array
ky_assure_array(mixed $value, mixed $value_on_null) : mixed
mixed
Value.
mixed
What to return if value is null.
mixed
ky_assure_bool(mixed $value) : bool
mixed
Value.
bool
ky_assure_constant(mixed $value, string | object $object_or_class_name, string $constant_prefix, mixed $value_on_invalid_constant) : mixed
mixed
Value.
string
object
Object or class name with constants.
string
Constants prefix (without last '_').
mixed
What to return if value is not a valid constant.
mixed
ky_assure_int(mixed $value, int | null $value_on_null) : int | null
mixed
Value.
int
null
What to return if value is null.
int
null
ky_assure_object(object $object, string $class_name, mixed $value_on_invalid_object) : mixed
object
Object.
string
Class name to check for.
mixed
What to return if object is not an instance os specified class.
mixed
ky_assure_positive_int(mixed $value, int | null $value_on_non_positive) : int | null
mixed
Value.
int
null
What to return if value non-positive (including null).
int
null
ky_assure_string(mixed $value, string | null $value_on_null) : string | null
mixed
Value.
string
null
What to return if value is null.
string
null
ky_bytes_format(int $bytes) : string
int
Bytes.
string
ky_get_post_value(\kyCustomFieldDefinition $custom_field_definition) : mixed
ky_get_tag_parameters(string $comment, string $tag_name) : bool | array
Custom PHPDoc used by this library tags have following format:
tagName | parameter1=value parameter2=value ... |
---|
string
PHPDoc block.
string
Custom tag name.
bool
array
List of parameters (may be empty if tag is parameter-less) or false when tag was not found.ky_seconds_format(int $seconds) : string
int
Seconds.
string
ky_usort_comparison(callback $callback, array $arguments) : callback
callback
Sorting callback.
array
List of arguments to sorting callback.
callback
ky_xml_to_array(string $xml, string[] $namespaces) : array
string
XML data.
string[]
List of namespaces to include in parsing or empty to include all namespaces.
array