Completed
Push — master ( 6af785...cbc83f )
by Iman
05:36
created

BaseSituation::setManager()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 0
cts 0
cp 0
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
namespace Imanghafoori\HeyMan\Situations;
4
5
use Imanghafoori\HeyMan\Chain;
6
7
abstract class BaseSituation
8
{
9
    public function hasMethod($method)
0 ignored issues
show
Unused Code introduced by
The parameter $method is not used and could be removed. ( Ignorable by Annotation )

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

9
    public function hasMethod(/** @scrutinizer ignore-unused */ $method)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
10
    {
11 10
        return false;
12
    }
13 10
14
    protected function setManager(string $class, ...$array)
15
    {
16
        resolve(Chain::class)->eventManager = resolve($class)->init(...$array);
0 ignored issues
show
Bug introduced by
The method init() 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

16
        resolve(Chain::class)->eventManager = resolve($class)->/** @scrutinizer ignore-call */ init(...$array);

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...
17
    }
18
}
19