helpers.php ➔ microscope_pretty_print_route()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 4
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
if (! function_exists('extractBlade')) {
4
    function extractBlade()
5
    {
6
        //
7
    }
8
}
9
10 View Code Duplication
if (! function_exists('microscope_pretty_print_route')) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
    function microscope_pretty_print_route($route)
0 ignored issues
show
Unused Code introduced by
The parameter $route is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
12
    {
13
        config()->push('microscope.write.routes', debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 1)[0]);
14
    }
15
}
16
17 View Code Duplication
if (! function_exists('microscope_write_route')) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
    function microscope_write_route(...$routes)
0 ignored issues
show
Unused Code introduced by
The parameter $routes is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
19
    {
20
        config()->push('microscope.write.routes', debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 1)[0]);
21
    }
22
}
23
24
if (! function_exists('microscope_dd_listeners')) {
25
    function microscope_dd_listeners($event)
26
    {
27
        config()->push('microscope.dump.listeners', $event);
28
        app()->booted(function () {
29
            $events = config('microscope.dump.listeners');
30
            foreach ($events as $event) {
31
                $listernsInfo = Event::getOriginalListeners($event);
32
                dump(' Event:  '.$event);
33
                dump(' Listeners: ');
34
                $sp = '     ';
35
                foreach ($listernsInfo as $i => $listenerInfo) {
36
                    dump($sp.($i + 1).' - '.$listenerInfo[0]);
37
                    $relPath = \Imanghafoori\LaravelMicroscope\LaravelPaths\FilePath::getRelativePath($listenerInfo[1]['file']);
38
                    dump($sp.'    at '.$relPath.':'.$listenerInfo[1]['line']);
39
                }
40
                dump('------------------------------------------');
41
            }
42
            dd();
43
        });
44
    }
45
}
46