class TypeHelper implements ProtectedContextAwareInterface (View source)

Type helper for Eel contexts

Methods

string
typeof(mixed $variable)

Get the variable type

string
getType(mixed $variable)

Get the variable type

string|null
className(object $variable)

Get the class name of the given variable or NULL if it wasn't an object

string
debugType(mixed $variable)

Get the classname for objects or type for other values

bool
isArray(mixed $variable)

Is the given variable an array.

bool
isString(mixed $variable)

Is the given variable a string.

bool
isNumeric(mixed $variable)

Is the given variable numeric.

bool
isInteger(mixed $variable)

Is the given variable an integer.

bool
isFloat(mixed $variable)

Is the given variable a float.

bool
isScalar(mixed $variable)

Is the given variable a scalar.

bool
isBoolean(mixed $variable)

Is the given variable boolean.

bool
isObject(mixed $variable)

Is the given variable an object.

bool
instance(mixed $variable, string $expectedObjectType)

Is the given variable of the provided object type.

bool
allowsCallOfMethod(string $methodName)

No description

Details

string typeof(mixed $variable)

Get the variable type

Parameters

mixed $variable

Return Value

string

string getType(mixed $variable)

Get the variable type

Parameters

mixed $variable

Return Value

string

See also

typeof()

string|null className(object $variable)

Get the class name of the given variable or NULL if it wasn't an object

Parameters

object $variable

Return Value

string|null

string debugType(mixed $variable)

Get the classname for objects or type for other values

Parameters

mixed $variable

Return Value

string

bool isArray(mixed $variable)

Is the given variable an array.

Parameters

mixed $variable

Return Value

bool

bool isString(mixed $variable)

Is the given variable a string.

Parameters

mixed $variable

Return Value

bool

bool isNumeric(mixed $variable)

Is the given variable numeric.

Parameters

mixed $variable

Return Value

bool

bool isInteger(mixed $variable)

Is the given variable an integer.

Parameters

mixed $variable

Return Value

bool

bool isFloat(mixed $variable)

Is the given variable a float.

Parameters

mixed $variable

Return Value

bool

bool isScalar(mixed $variable)

Is the given variable a scalar.

Parameters

mixed $variable

Return Value

bool

bool isBoolean(mixed $variable)

Is the given variable boolean.

Parameters

mixed $variable

Return Value

bool

bool isObject(mixed $variable)

Is the given variable an object.

Parameters

mixed $variable

Return Value

bool

bool instance(mixed $variable, string $expectedObjectType)

Is the given variable of the provided object type.

Parameters

mixed $variable
string $expectedObjectType

Return Value

bool

bool allowsCallOfMethod(string $methodName)

No description

Parameters

string $methodName

Return Value

bool