CheckGenericActionComments::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 14

Duplication

Lines 14
Ratio 100 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 14
loc 14
rs 9.7998
c 0
b 0
f 0
1
<?php
2
3
namespace Imanghafoori\LaravelMicroscope\Commands;
4
5
use Illuminate\Console\Command;
6
use Imanghafoori\LaravelMicroscope\Checks\ActionsUnDocblock;
7
use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter;
8
use Imanghafoori\LaravelMicroscope\Psr4Classes;
9
use Imanghafoori\LaravelMicroscope\Traits\LogsErrors;
10
11 View Code Duplication
class CheckGenericActionComments extends Command
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in 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...
12
{
13
    use LogsErrors;
14
15
    protected $signature = 'check:docblocks';
16
17
    protected $description = 'Removes generic docblocks from controllers';
18
19
    public function handle(ErrorPrinter $errorPrinter)
20
    {
21
        $errorPrinter->printer = $this->output;
22
23
        $this->info('removing generic docblocks...');
24
25
        ActionsUnDocblock::$command = $this;
26
27
        Psr4Classes::check([ActionsUnDocblock::class]);
28
29
        $this->finishCommand($errorPrinter);
30
31
        return $errorPrinter->hasErrors() ? 1 : 0;
32
    }
33
}
34