Completed
Push — master ( 210a64...050109 )
by Iman
05:21
created

DebugbarIntergrator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 88.89%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 16
ccs 8
cts 9
cp 0.8889
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 14 2
1
<?php
2
3
namespace Imanghafoori\HeyMan\Boot;
4
5
class DebugbarIntergrator
6
{
7 115
    public static function register()
8
    {
9 115
        if (! app()->offsetExists('debugbar')) {
10
            return;
11
        }
12
13 115
        app()->singleton('heyman.debugger', function () {
14 115
            return new \DebugBar\DataCollector\MessagesCollector('HeyMan');
15 115
        });
16
17 115
        app()->make('debugbar')->addCollector(app('heyman.debugger'));
18
19 115
        \Event::listen('heyman_reaction_is_happening', function (...$debug) {
0 ignored issues
show
Bug introduced by
The method listen() does not exist on Event. ( Ignorable by Annotation )

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

19
        \Event::/** @scrutinizer ignore-call */ 
20
                listen('heyman_reaction_is_happening', function (...$debug) {

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...
20 58
            app()['heyman_reaction_is_happened_in_debug'] = $debug;
21 115
        });
22 115
    }
23
}
24