Code Duplication    Length = 28-31 lines in 2 locations

src/Commands/CheckExtractBladeIncludes.php 1 location

@@ 11-41 (lines=31) @@
8
use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter;
9
use Imanghafoori\LaravelMicroscope\Traits\LogsErrors;
10
11
class CheckExtractBladeIncludes extends Command
12
{
13
    use LogsErrors;
14
15
    protected $signature = 'check:extract_blades';
16
17
    protected $description = 'Checks to extract blade partials';
18
19
    public function handle(ErrorPrinter $errorPrinter)
20
    {
21
        if (! $this->startWarning()) {
22
            return;
23
        }
24
25
        event('microscope.start.command');
26
27
        $errorPrinter->printer = $this->output;
28
29
        BladeFiles::check([ExtractBladePartial::class]);
30
31
        $this->info('Blade files extracted.');
32
    }
33
34
    private function startWarning()
35
    {
36
        $this->info('Checking to extract blade partials...');
37
        $this->warn('This command is going to make changes to your files!');
38
39
        return $this->output->confirm('Do you have committed everything in git?', true);
40
    }
41
}
42

src/Commands/CheckPsr12.php 1 location

@@ 12-39 (lines=28) @@
9
use Imanghafoori\LaravelMicroscope\Psr4Classes;
10
use Imanghafoori\LaravelMicroscope\Traits\LogsErrors;
11
12
class CheckPsr12 extends Command
13
{
14
    use LogsErrors;
15
16
    protected $signature = 'check:psr12';
17
18
    protected $description = 'Applies psr-12 rules';
19
20
    public function handle(ErrorPrinter $errorPrinter)
21
    {
22
        $errorPrinter->printer = $this->output;
23
24
        $this->info('Psr-12 is on the table...');
25
        $this->warn('This command is going to make changes to your files!');
26
27
        if (! $this->output->confirm('Do you have committed everything in git?', true)) {
28
            return;
29
        }
30
31
        ActionsComments::$command = $this;
32
33
        Psr4Classes::check([CurlyBraces::class]);
34
35
        $this->finishCommand($errorPrinter);
36
37
        return $errorPrinter->hasErrors() ? 1 : 0;
38
    }
39
}
40