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

PreReactions   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 17
ccs 7
cts 7
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A afterCalling() 0 3 1
A afterFiringEvent() 0 3 1
A pushIt() 0 5 1
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