| 1 | <?php |
||
| 11 | trait BooleanValidatorTrait |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Exceptions are caught in order to be processed later |
||
| 15 | * @param mixed $value Boolean ? |
||
| 16 | * |
||
| 17 | * @return boolean Value casted into boolean or false |
||
| 18 | */ |
||
| 19 | public function mustBeBoolean($value, string $propertyPath = null, UIValidatorInterface $parentValidator = null, string $exceptionMessage = null): bool |
||
| 40 | } |
||
| 41 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: