DebugbarIntergrator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 91.67%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 11
c 2
b 0
f 0
dl 0
loc 19
ccs 11
cts 12
cp 0.9167
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 17 2
1
<?php
2
3
namespace Imanghafoori\HeyMan\Boot;
4
5
use DebugBar\DataCollector\MessagesCollector;
6
use Illuminate\Support\Facades\Event;
7
8
class DebugbarIntergrator
9
{
10 121
    public static function register()
11
    {
12 121
        if (! app()->offsetExists('debugbar')) {
13
            return;
14
        }
15
16 121
        app()->singleton('heyman.debugger', function () {
17 121
            return new MessagesCollector('HeyMan');
18 121
        });
19
20 121
        app()->make('debugbar')->addCollector(app('heyman.debugger'));
21
22 121
        Event::listen('heyman_reaction_is_happening', function (...$debug) {
23 58
            app()['heyman_reaction_is_happened_in_debug'] = $debug;
24 58
            resolve('heyman.debugger')->addMessage('HeyMan Rule Matched in file: ');
25 58
            resolve('heyman.debugger')->addMessage($debug[0].' on line: '.$debug[1]);
26 58
            resolve('heyman.debugger')->addMessage($debug[2]);
27 121
        });
28 121
    }
29
}
30