Completed
Push — master ( a52e49...d03ec2 )
by Iman
09:53
created

DebugbarIntergrator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 10
dl 0
loc 18
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
    public static function register($app)
8
    {
9
        if (!$app->offsetExists('debugbar')) {
10
            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
            app('heyman.debugger')->addMessage('HeyMan Rule Matched in file: '.$debug[0]);
21
            app('heyman.debugger')->addMessage('on line: '.$debug[1]);
22
            app('heyman.debugger')->addMessage($debug[2]);
23
        });
24
    }
25
26
}