Final Class Yiisoft\Validator\EmptyCondition\NeverEmpty
| Inheritance | Yiisoft\Validator\EmptyCondition\NeverEmpty |
|---|
Empty condition is a callable returning true if a value must be considered empty.
With NeverEmpty a value is always considered non-empty. With regard to validation process, a corresponding rule is
never skipped if NeverEmpty is set:
- At a rule level via
$skipOnEmptyproperty, but only for rules implementing {@see \Yiisoft\Validator\Rule\Trait\SkipOnEmptyTrait} / including {@see \Yiisoft\Validator\Rule\Trait\SkipOnEmptyTrait}. - At validator level ({@see \Yiisoft\Validator\Validator::$defaultSkipOnEmptyCondition}).
This is a default behavior for all built-in rules.
A shortcut for new NeverEmpty() is false.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __invoke() | Yiisoft\Validator\EmptyCondition\NeverEmpty |
Method Details
| public boolean __invoke ( mixed $value, boolean $isPropertyMissing = false ) | ||
| $value | mixed |
The validated value. |
| $isPropertyMissing | boolean |
A flag defining whether the property is missing (not used / not passed at all). |
| return | boolean |
Whether the validated value is considered empty. |
|---|---|---|
public function __invoke(mixed $value, bool $isPropertyMissing = false): bool
{
return false;
}
Signup or Login in order to comment.