PHP Trait Webiny\Component\StdLib\ValidatorTrait

Show file Open project: Webiny/Framework

Protected Methods

Method Description
classExists ( string $className ) : boolean Checks if class exists.
is ( $var )
isArray ( $var ) : boolean Checks if given value is an array.
isArrayObject ( mixed $instance ) : boolean Check if $instance is an ArrayObject.
isBool ( $var ) : boolean Checks if $var is type of boolean.
isBoolean ( $var ) : boolean This is an alias function for self::isBool
isCallable ( $var ) : boolean Checks whenever resource is callable.
isDateTimeObject ( mixed $instance ) : boolean Check if $instance is a DateTimeObject.
isDirectory ( $var ) : boolean Checks if $var is a directory.
isEmpty ( mixed $var ) : boolean Checks if given value is empty.
isFile ( $var ) : boolean Checks if $var is a file.
isFileObject ( mixed $instance ) : boolean Check if $instance is a FileObject.
isInstanceOf ( mixed $instance, string $type ) : boolean Check if $instance is of $type.
isInteger ( $var ) : boolean Checks if value is an integer.
isNull ( mixed $var ) : boolean Checks if given value is null.
isNumber ( $var ) : boolean Checks if value is a number.
isObject ( mixed $var ) : boolean Check if given value is an object.
isReadable ( $var ) : boolean Checks if $var is readable.
isResource ( mixed $var ) : boolean Check if given value is a resource.
isScalar ( mixed $var ) : boolean Check if given value is a scalar value.
isStdObject ( mixed $instance ) : boolean Check if $instance is a StandardObject.
isString ( $var ) : boolean Checks if $var is type of string.
isStringObject ( mixed $instance ) : boolean Check if $instance is a StringObject.
isSubClassOf ( string | object $subclass, string $class ) : boolean Check if $subclass is a subclass of $class.
isUrlObject ( mixed $instance ) : boolean Check if $instance is a UrlObject.
methodExists ( object $instance, string $methodName ) : boolean Checks if given object $instance has the given method.

Method Details

classExists() protected static method

This function autoloads classes to checks if they exist.
protected static classExists ( string $className ) : boolean
$className string Class name with their full namespace.
return boolean

is() protected static method

protected static is ( $var )

isArray() protected static method

Checks if given value is an array.
protected static isArray ( $var ) : boolean
$var
return boolean

isArrayObject() protected static method

Check if $instance is an ArrayObject.
protected static isArrayObject ( mixed $instance ) : boolean
$instance mixed
return boolean

isBool() protected static method

Checks if $var is type of boolean.
protected static isBool ( $var ) : boolean
$var
return boolean

isBoolean() protected static method

This is an alias function for self::isBool
protected static isBoolean ( $var ) : boolean
$var
return boolean

isCallable() protected static method

Checks whenever resource is callable.
protected static isCallable ( $var ) : boolean
$var
return boolean

isDateTimeObject() protected static method

Check if $instance is a DateTimeObject.
protected static isDateTimeObject ( mixed $instance ) : boolean
$instance mixed
return boolean

isDirectory() protected static method

Checks if $var is a directory.
protected static isDirectory ( $var ) : boolean
$var
return boolean

isEmpty() protected static method

Checks if given value is empty.
protected static isEmpty ( mixed $var ) : boolean
$var mixed Value to check
return boolean

isFile() protected static method

Checks if $var is a file.
protected static isFile ( $var ) : boolean
$var
return boolean

isFileObject() protected static method

Check if $instance is a FileObject.
protected static isFileObject ( mixed $instance ) : boolean
$instance mixed
return boolean

isInstanceOf() protected static method

Check if $instance is of $type.
protected static isInstanceOf ( mixed $instance, string $type ) : boolean
$instance mixed
$type string
return boolean

isInteger() protected static method

Checks if value is an integer.
protected static isInteger ( $var ) : boolean
$var
return boolean

isNull() protected static method

Checks if given value is null.
protected static isNull ( mixed $var ) : boolean
$var mixed Value to check
return boolean

isNumber() protected static method

Checks if value is a number.
protected static isNumber ( $var ) : boolean
$var
return boolean

isObject() protected static method

Check if given value is an object.
protected static isObject ( mixed $var ) : boolean
$var mixed Value to check
return boolean

isReadable() protected static method

Checks if $var is readable.
protected static isReadable ( $var ) : boolean
$var
return boolean

isResource() protected static method

Check if given value is a resource.
protected static isResource ( mixed $var ) : boolean
$var mixed Value to check
return boolean

isScalar() protected static method

Scalar values are: integer, float, boolean and string
protected static isScalar ( mixed $var ) : boolean
$var mixed Value to check
return boolean

isStdObject() protected static method

Check if $instance is a StandardObject.
protected static isStdObject ( mixed $instance ) : boolean
$instance mixed
return boolean

isString() protected static method

Checks if $var is type of string.
protected static isString ( $var ) : boolean
$var
return boolean

isStringObject() protected static method

Check if $instance is a StringObject.
protected static isStringObject ( mixed $instance ) : boolean
$instance mixed
return boolean

isSubClassOf() protected static method

Check if $subclass is a subclass of $class.
protected static isSubClassOf ( string | object $subclass, string $class ) : boolean
$subclass string | object
$class string
return boolean

isUrlObject() protected static method

Check if $instance is a UrlObject.
protected static isUrlObject ( mixed $instance ) : boolean
$instance mixed
return boolean

methodExists() protected static method

Checks if given object $instance has the given method.
protected static methodExists ( object $instance, string $methodName ) : boolean
$instance object Object instance.
$methodName string Name of the method you wish to check.
return boolean