Passed
Push — master ( c61266...84ac3f )
by Iman
11:29 queued 08:42
created

HeyMan::__call()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3.3332

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 10
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0
cc 3
nc 2
nop 2
crap 3.3332
1
<?php
2
3
namespace Imanghafoori\HeyMan;
4
5
use Imanghafoori\HeyMan\MakeSure\HttpClient;
6
use Imanghafoori\HeyMan\Situations\SituationsProxy;
7
use Imanghafoori\HeyMan\Switching\Turn;
8
9
class HeyMan
10
{
11
    use Turn;
12
13 14
    public function forget(): Forget
14
    {
15 14
        return new Forget();
16
    }
17
18 105
    public function __call($method, $args)
19
    {
20 105
        resolve(ChainManager::class)->startChain();
21
22 105
        if (config()->get('app.debug') and !app()->environment('production')) {
0 ignored issues
show
introduced by
The method environment() does not exist on Illuminate\Container\Container. Are you sure you never get this type here, but always one of the subclasses? ( Ignorable by Annotation )

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

22
        if (config()->get('app.debug') and !app()->/** @scrutinizer ignore-call */ environment('production')) {
Loading history...
23
            $d = array_only(debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 2)[1], ['file', 'line', 'args']);
24
            resolve(ChainManager::class)->set('debugInfo', $d);
25
        }
26
27 105
        return  SituationsProxy::call($method, $args);
28
    }
29
30 38
    public function makeSure($app): HttpClient
31
    {
32 38
        return new HttpClient($app);
33
    }
34
35 2
    public function checkPoint($pointName)
36
    {
37 2
        event('heyman_checkpoint_'.$pointName);
38 1
    }
39
}
40