Test Failed
Push — master ( 788073...933e0a )
by Iman
02:31
created

src/Reactions/Validator.php (2 issues)

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);
0 ignored issues
show
$data is expanded, but the parameter $rules of Imanghafoori\HeyMan\Reac...ry::validatorCallback() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

28
        $condition = resolve(ResponderFactory::class)->validatorCallback($modifier, /** @scrutinizer ignore-type */ ...$data);
Loading history...
29 8
        $chain->set('condition', $condition);
0 ignored issues
show
The method set() does not exist on Illuminate\Foundation\Application. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

29
        $chain->/** @scrutinizer ignore-call */ 
30
                set('condition', $condition);

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.

Loading history...
30 8
        resolve('heyman.chains')->commitChain();
31 8
    }
32
}
33