\Orpheus\DataTypeFileType

The TypeValidator class

Summary

Methods
Properties
Constants
__construct()
getValueFrom()
validate()
checkByRegex()
check()
parse()
format()
getName()
isFalsable()
No public properties found
No constants found
No protected methods found
$name
$regex
N/A
No private methods found
No private properties found
N/A

Properties

$name

$name : string

The name

Type

string

$regex

$regex : string

The regex to validate a value

Type

string

Methods

__construct()

__construct() 

Constructor

getValueFrom()

getValueFrom(array  $values, string  $argName, string  $argAltName) : mixed

Get value from input array

Parameters

array $values
string $argName
string $argAltName

Returns

mixed —

Getting $values from getopt()

validate()

validate(mixed  $value) : boolean

Validate the given value with this type

Parameters

mixed $value

Returns

boolean

checkByRegex()

checkByRegex(mixed  $value) : boolean

Check this value if valid using the regex

Parameters

mixed $value

Returns

boolean

check()

check(mixed  $value) : boolean

Check this value is valid

Parameters

mixed $value

Returns

boolean

parse()

parse(mixed  $value) : mixed

From human to machine

Parameters

mixed $value

Returns

mixed

format()

format(mixed  $value) : mixed

From machine to human

Parameters

mixed $value

Returns

mixed

getName()

getName() : string

Get the name

Returns

string

isFalsable()

isFalsable() : boolean

Is this type falsable ?

Returns

boolean —

Only boolean should be