BooleanType
extends AbstractType
in package
Table of Contents
Properties
Methods
- __construct() : mixed
- Constructor
- check() : bool
- Check this value is valid
- checkByRegex() : bool
- Check this value if valid using the regex
- format() : mixed
- From machine to human
- getName() : string
- Get the name
- getValueFrom() : mixed
- Get value from input array
- isFalsable() : bool
- Is this type falsable ? Only boolean should be
- parse() : bool
- From human to machine Expecting a string but must be idempotent
- validate() : bool
- Validate the given value with this type
Properties
$name
The name
protected
string
$name
$regex
The regex to validate a value
protected
string|null
$regex
Methods
__construct()
Constructor
public
__construct() : mixed
check()
Check this value is valid
public
check(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolcheckByRegex()
Check this value if valid using the regex
public
checkByRegex(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolformat()
From machine to human
public
format(mixed $value) : mixed
Parameters
- $value : mixed
getName()
Get the name
public
getName() : string
Return values
stringgetValueFrom()
Get value from input array
public
getValueFrom(array<string|int, mixed> $values, string $argName, string|null $argAltName) : mixed
Parameters
- $values : array<string|int, mixed>
- $argName : string
- $argAltName : string|null
isFalsable()
Is this type falsable ? Only boolean should be
public
isFalsable() : bool
Return values
boolparse()
From human to machine Expecting a string but must be idempotent
public
parse(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolvalidate()
Validate the given value with this type
public
validate(mixed $value) : bool
Parameters
- $value : mixed