1 | <?php |
||
2 | |||
3 | namespace Imanghafoori\HeyMan\Reactions; |
||
4 | |||
5 | final class Validator |
||
6 | { |
||
7 | private $validationData; |
||
8 | |||
9 | private $modifier; |
||
10 | |||
11 | 8 | public function __construct(array $validationData) |
|
12 | { |
||
13 | 8 | $this->validationData = $validationData; |
|
14 | 8 | } |
|
15 | |||
16 | 1 | public function beforeValidationModifyData($callable) |
|
17 | { |
||
18 | 1 | $this->modifier = $callable; |
|
19 | 1 | } |
|
20 | |||
21 | 8 | public function __destruct() |
|
22 | { |
||
23 | 8 | $data = $this->validationData; |
|
24 | 8 | $modifier = $this->modifier ?: function ($args) { |
|
25 | 4 | return $args; |
|
26 | 8 | }; |
|
27 | 8 | $chain = resolve('heyman.chain'); |
|
28 | 8 | $condition = resolve(ResponderFactory::class)->validatorCallback($modifier, ...$data); |
|
29 | 8 | $chain->set('condition', $condition); |
|
0 ignored issues
–
show
|
|||
30 | 8 | resolve('heyman.chains')->commitChain(); |
|
31 | 8 | } |
|
32 | } |
||
33 |
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.