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