Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2.0116 |
Changes | 0 |
1 | <?php |
||
34 | 9 | public function getRule(string $key, array $args = []) : \PluginSimpleValidate\Contracts\Rule |
|
35 | { |
||
36 | 9 | if (!isset($this->list[$key])) { |
|
37 | throw new RuleNotExist('Rule does not exist'); |
||
38 | } |
||
39 | |||
40 | 9 | return new Rule( |
|
41 | 9 | $this->list[$key]['validation_method'], |
|
42 | 9 | $this->list[$key]['lang_key'], |
|
43 | 9 | $args |
|
44 | ); |
||
45 | } |
||
46 | } |