Completed
Push — master ( 6ed379...0314c3 )
by Iman
03:32
created

DebugbarIntergrator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 27.27%

Importance

Changes 0
Metric Value
wmc 2
eloc 10
dl 0
loc 18
ccs 3
cts 11
cp 0.2727
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 16 2
1
<?php
2
3
namespace Imanghafoori\HeyMan\Boot;
4
5
class DebugbarIntergrator
6
{
7 106
    public static function register()
8
    {
9 106
        if (!app()->offsetExists('debugbar')) {
10 106
            return;
11
        }
12
13
        app()->singleton('heyman.debugger', function () {
14
            return new \DebugBar\DataCollector\MessagesCollector('HeyMan');
0 ignored issues
show
Bug introduced by
The type DebugBar\DataCollector\MessagesCollector 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...
15
        });
16
17
        app()->make('debugbar')->addCollector(app('heyman.debugger'));
18
19
        \Event::listen('heyman_reaction_is_happening', function (...$debug) {
20
            resolve('heyman.debugger')->addMessage('HeyMan Rule Matched in file: '.$debug[0]);
21
            resolve('heyman.debugger')->addMessage('on line: '.$debug[1]);
22
            resolve('heyman.debugger')->addMessage($debug[2]);
23
        });
24
    }
25
}
26