class MixedType (View source)

Methods

static array
toArray(mixed $argument)

Converts a value to an array containing this value unless it is an array

static mixed
value(mixed $entity, array $arguments = [], string $method = '__invoke')

Executes a value depending on what type it is and returns the result Callable: call; return result Instance: call method; return result Class: instantiate; call method; return result Other: return value without taking any action

static boolean
isClass(mixed $class_name)

Check if a value is a valid class name

static string
normalizePath(string $path, string $replace_with = DIRECTORY_SEPARATOR)

Normalize a path's slashes according to the current OS.

Details

static array toArray(mixed $argument)

Converts a value to an array containing this value unless it is an array

Parameters

mixed $argument

Return Value

array

static mixed value(mixed $entity, array $arguments = [], string $method = '__invoke')

Executes a value depending on what type it is and returns the result Callable: call; return result Instance: call method; return result Class: instantiate; call method; return result Other: return value without taking any action

Parameters

mixed $entity
array $arguments
string $method

Return Value

mixed

static boolean isClass(mixed $class_name)

Check if a value is a valid class name

Parameters

mixed $class_name

Return Value

boolean

static string normalizePath(string $path, string $replace_with = DIRECTORY_SEPARATOR)

Normalize a path's slashes according to the current OS.

Solves mixed slashes that are sometimes returned by WordPress core functions.

Parameters

string $path
string $replace_with

Return Value

string