ClassifyStrings   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 5

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 14 2
1
<?php
2
3
namespace Imanghafoori\LaravelMicroscope\Commands;
4
5
use Illuminate\Console\Command;
6
use Imanghafoori\LaravelMicroscope\Checks\CheckStringy;
7
use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter;
8
use Imanghafoori\LaravelMicroscope\Psr4Classes;
9
use Imanghafoori\LaravelMicroscope\Traits\LogsErrors;
10
11
class ClassifyStrings extends Command
12
{
13
    use LogsErrors;
14
15
    public static $checkedCallsNum = 0;
16
17
    protected $signature = 'check:stringy_classes';
18
19
    protected $description = 'Replaces string references with ::class version of them';
20
21
    public function handle(ErrorPrinter $errorPrinter)
22
    {
23
        $this->info('Checking stringy classes...');
24
        app()->singleton('current.command', function () {
25
            return $this;
26
        });
27
        $errorPrinter->printer = $this->output;
28
        Psr4Classes::check([CheckStringy::class]);
29
        $this->getOutput()->writeln(' - Finished looking for stringy classes.');
30
31
        $this->finishCommand($errorPrinter);
32
33
        return $errorPrinter->hasErrors() ? 1 : 0;
34
    }
35
}
36