Functions

Returns specified value as array.

ky_assure_array(mixed $value, mixed $value_on_null) : mixed

Parameters

$value

mixed

Value.

$value_on_null

mixed

What to return if value is null.

Returns

mixed

Returns specified value as bool.

ky_assure_bool(mixed $value) : bool

Parameters

$value

mixed

Value.

Returns

bool

Assures that specified value is proper constant value.

ky_assure_constant(mixed $value, string | object $object_or_class_name, string $constant_prefix, mixed $value_on_invalid_constant) : mixed

Parameters

$value

mixed

Value.

$object_or_class_name

stringobject

Object or class name with constants.

$constant_prefix

string

Constants prefix (without last '_').

$value_on_invalid_constant

mixed

What to return if value is not a valid constant.

Returns

mixed

Returns specified value as int.

ky_assure_int(mixed $value, int | null $value_on_null) : int | null

Parameters

$value

mixed

Value.

$value_on_null

intnull

What to return if value is null.

Returns

intnull

Returns specified object only if it is an instance of specified class.

ky_assure_object(object $object, string $class_name, mixed $value_on_invalid_object) : mixed

Parameters

$object

object

Object.

$class_name

string

Class name to check for.

$value_on_invalid_object

mixed

What to return if object is not an instance os specified class.

Returns

mixed

Returns specified value as positive int.

ky_assure_positive_int(mixed $value, int | null $value_on_non_positive) : int | null

Parameters

$value

mixed

Value.

$value_on_non_positive

intnull

What to return if value non-positive (including null).

Returns

intnull

Returns specified value as string.

ky_assure_string(mixed $value, string | null $value_on_null) : string | null

Parameters

$value

mixed

Value.

$value_on_null

stringnull

What to return if value is null.

Returns

stringnull

Outputs formatted bytes.

ky_bytes_format(int $bytes) : string

Parameters

$bytes

int

Bytes.

Returns

string

Returns field value from POST data.

ky_get_post_value(\kyCustomFieldDefinition $custom_field_definition) : mixed

Parameters

$custom_field_definition

\kyCustomFieldDefinition

Custom field definition.

Exceptions

\kyException

Returns

mixedField value.

Returns custom PHPDoc tag parameter list.

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

Parameters

$comment

string

PHPDoc block.

$tag_name

string

Custom tag name.

Returns

boolarrayList of parameters (may be empty if tag is parameter-less) or false when tag was not found.

Outputs seconds in hh:mm:ss format.

ky_seconds_format(int $seconds) : string

Parameters

$seconds

int

Seconds.

Returns

string

Helper function for sorting array with parametrized callback.

ky_usort_comparison(callback $callback, array $arguments) : callback

Parameters

$callback

callback

Sorting callback.

$arguments

array

List of arguments to sorting callback.

Returns

callback

Transforms XML data to array.

ky_xml_to_array(string $xml, string[] $namespaces) : array

Parameters

$xml

string

XML data.

$namespaces

string[]

List of namespaces to include in parsing or empty to include all namespaces.

Returns

array

Classes and interfaces

kyConfig

Class holding library configuration.

« More »

kyException

Base exception class used by library.

« More »

kyResultSet

List of objects on steroids.

« More »

kyUsort

Helper class for sorting array with parametrized callback.

« More »

Classes and interfaces

kyRESTClientInterface

Interface of REST client.

« More »

kyRESTClient

Default REST client implementation.

« More »