Conditions | 3 |
Paths | 2 |
Total Lines | 25 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | protected function makeExtraFieldsValidator() |
||
15 | { |
||
16 | /** @var ValidationFactory $factory */ |
||
17 | $factory = $this->container->make(ValidationFactory::class); |
||
18 | $rules = method_exists($this, 'rules') ? $this->container->call([$this, 'rules']) : []; |
||
19 | $data = $this->validationData(); |
||
1 ignored issue
–
show
|
|||
20 | |||
21 | /** @var Validator $validator */ |
||
22 | $validator = $factory->make($data, $rules, $this->messages(), $this->attributes()); |
||
2 ignored issues
–
show
|
|||
23 | |||
24 | return $validator->afterSuccess(function (Validator $validator) { |
||
25 | /** @var ExtraFieldsDetector $detector */ |
||
26 | $detector = $this->container->make( |
||
27 | config('extra-validator.extra_fields_detector', ExtraFieldsDetector::class) |
||
28 | ); |
||
29 | |||
30 | $extraField = $detector->getFirstExtraField($validator->getData(), $validator->getRules()); |
||
31 | |||
32 | if (is_null($extraField)) { |
||
33 | return true; |
||
34 | } |
||
35 | |||
36 | $validator->errors()->add($extraField, $this->getExtraFieldErrorMessage($extraField)); |
||
37 | |||
38 | return false; |
||
39 | }); |
||
47 |
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.