| Conditions | 5 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 20 | public function isValid() |
||
| 21 | { |
||
| 22 | if ($this->isNotRequiredAndEmpty()) { |
||
| 23 | return true; |
||
| 24 | } |
||
| 25 | |||
| 26 | $input = trim($this->getParams()[1]); |
||
| 27 | $value = trim($this->getParams()[2]); |
||
| 28 | |||
| 29 | if ($this->hasRule('numeric') !== false && is_numeric($input)) { |
||
| 30 | $this->isNumeric = true; |
||
| 31 | |||
| 32 | return $this->Min($value, true)->validate($input); |
||
|
|
|||
| 33 | } |
||
| 34 | |||
| 35 | // there is no way respect/validator supports string for rule 'Min' |
||
| 36 | return is_string($input) && strlen($input) >= $value; |
||
| 37 | } |
||
| 38 | |||
| 48 |
If you implement
__calland you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__callis implemented by a parent class and only the child class knows which methods exist: