Conditions | 3 |
Paths | 3 |
Total Lines | 21 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
36 | public function check($value): bool |
||
37 | { |
||
38 | $this->requireParameters(['fields']); |
||
39 | |||
40 | $fields = $this->parameter('fields'); |
||
41 | $validator = $this->validation->getValidator(); |
||
|
|||
42 | |||
43 | $this->setParameterTextValues($fields, 'values'); |
||
44 | |||
45 | foreach ($fields as $field) { |
||
46 | if (! $this->validation->hasValue($field)) { |
||
47 | return true; |
||
48 | } |
||
49 | } |
||
50 | |||
51 | $presentValidator = $validator('present'); |
||
52 | |||
53 | $presentValidator->setValidation($this->validation); |
||
54 | $presentValidator->setAttribute($this->attribute); |
||
55 | |||
56 | return $presentValidator->check($value); |
||
57 | } |
||
59 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.