Ubiquity
2.5.2
php rapid development framework
Loading...
Searching...
No Matches
IsBooleanValidator.php
Go to the documentation of this file.
1
<?php
2
6
namespace
Ubiquity\contents\validation\validators\basic
;
7
8
use
Ubiquity\utils\base\UString
;
9
use
Ubiquity\contents\validation\validators\ValidatorHasNotNull
;
10
11
class
IsBooleanValidator
extends
ValidatorHasNotNull
{
12
13
public
function
__construct
() {
14
$this->message =
"This value should be a boolean"
;
15
}
16
17
public
function
validate
(
$value
) {
18
parent::validate (
$value
);
19
if
($this->notNull !==
false
) {
20
return
UString::isBooleanStr (
$value
);
21
}
22
return
true
;
23
}
24
30
public
function
getParameters
(): array {
31
return [
"value"
];
32
}
33
}
34
Ubiquity\contents\validation\validators\ValidatorHasNotNull
Definition
ValidatorHasNotNull.php:8
Ubiquity\contents\validation\validators\Validator\$value
$value
Definition
Validator.php:15
Ubiquity\contents\validation\validators\basic\IsBooleanValidator
Definition
IsBooleanValidator.php:11
Ubiquity\contents\validation\validators\basic\IsBooleanValidator\getParameters
getParameters()
{{}\Ubiquity\contents\validation\validators\ValidatorInterfacegetParameters()}
Definition
IsBooleanValidator.php:30
Ubiquity\contents\validation\validators\basic\IsBooleanValidator\__construct
__construct()
Definition
IsBooleanValidator.php:13
Ubiquity\contents\validation\validators\basic\IsBooleanValidator\validate
validate($value)
Definition
IsBooleanValidator.php:17
Ubiquity\utils\base\UString
String utilities.
Definition
UString.php:15
Ubiquity\contents\validation\validators\basic
Basic validators.
Definition
IsBooleanValidator.php:6
C:
Users
myadd
Documents
GitHub
ubiquity-doc-api
vendor
phpmv
ubiquity
src
Ubiquity
contents
validation
validators
basic
IsBooleanValidator.php
Generated on Sun Dec 10 2023 15:04:14 for
Ubiquity
by
doxygen
1.9.8