| Conditions | 2 |
| Paths | 2 |
| Total Lines | 24 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 84 | 9 | public function isValid(Language $language, $value) : bool |
|
| 85 | { |
||
| 86 | 9 | if (!call_user_func_array( |
|
| 87 | 9 | '\\PluginSimpleValidate\\helper\\Validate\\' . $this->getValidationMethod(), |
|
| 88 | [ |
||
| 89 | 9 | $value, |
|
| 90 | 9 | $this->args |
|
| 91 | ] |
||
| 92 | )) { |
||
| 93 | 9 | $this->status = false; |
|
| 94 | |||
| 95 | 9 | $this->error = vsprintf( |
|
| 96 | 9 | $language->getTranslation( |
|
| 97 | 9 | $this->getLangKey() |
|
| 98 | ), |
||
| 99 | 9 | $this->args |
|
| 100 | ); |
||
| 101 | |||
| 102 | } else { |
||
| 103 | 1 | $this->status = true; |
|
| 104 | } |
||
| 105 | |||
| 106 | 9 | return $this->status; |
|
| 107 | } |
||
| 108 | |||
| 116 | } |