Completed
Push — master ( 2fec7f...f11719 )
by Iman
02:20
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\Switching\Turn;
6
use Imanghafoori\HeyMan\MakeSure\HttpClient;
0 ignored issues
show
Bug introduced by
The type Imanghafoori\HeyMan\MakeSure\HttpClient was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Imanghafoori\HeyMan\Conditions\ConditionsFacade;
8
use Imanghafoori\HeyMan\WatchingStrategies\SituationsProxy;
9
10
class HeyMan
11
{
12
    use Turn;
13
14 14
    public function forget(): Forget
15
    {
16 14
        return new Forget();
17
    }
18
19 106
    public function __call($method, $args)
20
    {
21 106
        resolve('heyman.chain')->startChain();
0 ignored issues
show
Bug introduced by
The method startChain() 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 */ startChain();

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 106
        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

23
        if (config()->get('app.debug') and ! app()->/** @scrutinizer ignore-call */ environment('production')) {
Loading history...
24
            $info = array_only(debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 2)[1], ['file', 'line', 'args']);
25
            resolve('heyman.chain')->set('debugInfo', $info);
0 ignored issues
show
Bug introduced by
The method set() 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

25
            resolve('heyman.chain')->/** @scrutinizer ignore-call */ set('debugInfo', $info);

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...
26
        }
27
28 106
        return  SituationsProxy::call($method, $args);
29
    }
30
31
    public function makeSure($testCase): HttpClient
32
    {
33
        return new HttpClient($testCase);
34
    }
35
36 2
    public function checkPoint(string $pointName)
37
    {
38 2
        event('heyman_checkpoint_'.$pointName);
39 1
    }
40
41 1
    public function condition(string $name, $callable)
42
    {
43 1
        app(ConditionsFacade::class)->define($name, $callable);
44 1
    }
45
}
46