Passed
Push — master ( 685e2a...9f4f72 )
by Iman
03:13
created

Redirector::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Imanghafoori\HeyMan\Plugins\Reactions\Redirect;
4
5
use Imanghafoori\HeyMan\Reactions\PreReactions;
0 ignored issues
show
Bug introduced by
The type Imanghafoori\HeyMan\Reactions\PreReactions was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
/**
8
 * Class Redirector.
9
 *
10
 * @method RedirectMsg to(string $path, int $status = 302, array $headers = [], $secure = null)
11
 * @method RedirectMsg route(string $route, array $parameters = [], int $status = 302, array $headers = [])
12
 * @method RedirectMsg action($action, array $parameters = [], int $status = 302, array $headers = [])
13
 * @method RedirectMsg guest($path, int $status = 302, array $headers = [], $secure = null)
14
 * @method RedirectMsg intended(string $default = '/', int $status = 302, array $headers = [], $secure = null)
15
 */
16
class Redirector
17
{
18
    private $action;
19
20
    /**
21
     * Responder constructor.
22
     *
23
     * @param PreReactions $reaction
24
     */
25 8
    public function __construct($reaction)
26
    {
27 8
        $this->action = $reaction;
28 8
    }
29
30 8
    public function __call($method, $parameters)
31
    {
32 8
        resolve('heyman.chain')->push('data', [$method, $parameters]);
0 ignored issues
show
Bug introduced by
The method push() 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

32
        resolve('heyman.chain')->/** @scrutinizer ignore-call */ push('data', [$method, $parameters]);

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...
33
34 8
        return new RedirectionMsg($this);
35
    }
36
}
37