FindInvalidViewCallsCommand::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Juddling\RouteChecker\Commands;
4
5
use Juddling\RouteChecker\FindInvalidViewCalls;
6
7
class FindInvalidViewCallsCommand extends BaseCommand
8
{
9
    protected $signature = 'runtime-errors:view-calls';
10
    protected $description = 'Checks your view calls to see if they map to a file that exists';
11
    protected $routeCalls;
12
13
    public function __construct(FindInvalidViewCalls $views)
14
    {
15
        $this->views = $views;
0 ignored issues
show
Bug Best Practice introduced by
The property views does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
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->views->findFunctionCalls($file);
25
            }
26
        }
27
28
        $this->views->renderTable($this->getOutput());
29
    }
30
}
31