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

PreReactions::afterCalling()   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 2
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Imanghafoori\HeyMan\Plugins\PreReaction;
4
5
use Imanghafoori\HeyMan\Core\Reaction;
6
7
final class PreReactions
8
{
9 2
    public function afterCalling($callback, array $parameters = [])
10
    {
11 2
        return $this->pushIt([[$callback, $parameters], 'cb']);
12
    }
13
14 1
    public function afterFiringEvent($event, $payload = [], $halt = false)
15
    {
16 1
        return $this->pushIt([[$event, $payload, $halt], 'event']);
17
    }
18
19 3
    private function pushIt($action)
20
    {
21 3
        resolve('heyman.chain')->push('beforeReaction', $action);
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

21
        resolve('heyman.chain')->/** @scrutinizer ignore-call */ push('beforeReaction', $action);

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...
22
23 3
        return resolve(Reaction::class);
24
    }
25
}
26