Responder::__call()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 2
c 1
b 1
f 0
nc 1
nop 2
dl 0
loc 5
rs 10
ccs 3
cts 3
cp 1
crap 1
1
<?php
2
3
namespace Imanghafoori\HeyMan\Reactions;
4
5
/**
6
 * Class Responder.
7
 *
8
 * @method Then make(string $content = '', int $status = 200, array $headers = [])
9
 * @method Then view(string $view, array $data = [], int $status = 200, array $headers = [])
10
 * @method Then json($data = [], $status = 200, array $headers = [], $options = 0)
11
 * @method Then jsonp($callback, $data = [], $status = 200, array $headers = [], $options = 0)
12
 * @method Then stream($callback, $status = 200, array $headers = [])
13
 * @method Then streamDownload($callback, $name = null, array $headers = [], $disposition = 'attachment')
14
 * @method Then download($file, $name = null, array $headers = [], $disposition = 'attachment')
15
 */
16
final class Responder
17
{
18
    private $action;
19
20 5
    public function __construct($action)
21
    {
22 5
        $this->action = $action;
23 5
    }
24
25 5
    public function __call($method, $parameters)
26
    {
27 5
        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

27
        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...
28
29 5
        return new Then($this->action);
30
    }
31
}
32