Ubiquity/contents/validation/validators/basic/TypeValidator.php 1 location
|
@@ 16-18 (lines=3) @@
|
| 13 |
|
} |
| 14 |
|
|
| 15 |
|
public function validate($value) { |
| 16 |
|
if ($this->notNull!==false && (null === $value || '' === $value)) { |
| 17 |
|
return; |
| 18 |
|
} |
| 19 |
|
$type = strtolower($this->ref); |
| 20 |
|
$type = 'boolean' == $type?'bool':$type; |
| 21 |
|
$isFunction = 'is_'.$type; |
Ubiquity/contents/validation/validators/Validator.php 1 location
|
@@ 63-65 (lines=3) @@
|
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
public function validate($value) { |
| 63 |
|
if ($this->notNull!==false && (null === $value || '' === $value)) { |
| 64 |
|
return; |
| 65 |
|
} |
| 66 |
|
if (!UString::isValid($value)) { |
| 67 |
|
throw new ValidatorException('This value can not be converted to string'); |
| 68 |
|
} |