DieDumpCallsCommand::handle()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 4
nc 3
nop 0
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Juddling\RouteChecker\Commands;
4
5
use Juddling\RouteChecker\FindDieDumpCalls;
6
7
class DieDumpCallsCommand extends BaseCommand
8
{
9
    protected $signature = 'runtime-errors:dd';
10
    protected $description = 'Flags all calls to the dd() function';
11
    protected $functionCalls;
12
13
    public function __construct(FindDieDumpCalls $functionCalls)
14
    {
15
        $this->functionCalls = $functionCalls;
16
17
        parent::__construct();
18
    }
19
20
    public function handle()
21
    {
22
        foreach ($this->getAllFilesInDir(getcwd(), 'php') as $file) {
23
            if (!$this->blacklisted($file)) {
24
                $this->functionCalls->findFunctionCalls($file);
25
            }
26
        }
27
28
        $this->functionCalls->renderTable($this->getOutput());
29
    }
30
}
31