Code Duplication    Length = 7-7 lines in 3 locations

src/Command/MultiAuthPrepare.php 3 locations

@@ 596-602 (lines=7) @@
593
            file_put_contents($ensureEmailIsVerifiedMiddlewareFile, $ensureEmailIsVerifiedMiddlewareFileeContent);
594
        }
595
596
        if (! Str::contains($redirectIfMiddlewareFileContent, 'MultiAuthGuards')) {
597
            // replace old file
598
            $deleted = unlink($redirectIfMiddlewareFile);
599
            if ($deleted) {
600
                file_put_contents($redirectIfMiddlewareFile, $redirectIfMiddlewareContentNew);
601
            }
602
        }
603
604
        if (! Str::contains($authenticateMiddlewareFileContent, 'MultiAuthGuards')) {
605
            // replace old file
@@ 604-610 (lines=7) @@
601
            }
602
        }
603
604
        if (! Str::contains($authenticateMiddlewareFileContent, 'MultiAuthGuards')) {
605
            // replace old file
606
            $deleted = unlink($authenticateMiddlewareFile);
607
            if ($deleted) {
608
                file_put_contents($authenticateMiddlewareFile, $authenticateMiddlewareContentNew);
609
            }
610
        }
611
612
        $redirectIfMiddlewareGroupContentNew = file_get_contents(__DIR__ . '/../Stubs/Middleware/redirectMiddleware.stub');
613
        $redirectIfMiddlewareGuardContentNew = file_get_contents(__DIR__ . '/../Stubs/Middleware/redirectMiddlewareGuard.stub');
@@ 650-656 (lines=7) @@
647
        $exceptionHandlerFileContentNew = file_get_contents(__DIR__ . '/../Stubs/Exceptions/handlerUnauthorized.stub');
648
649
650
        if (! Str::contains($exceptionHandlerFileContent, 'MultiAuthUnAuthenticated')) {
651
            // replace old file
652
            $deleted = unlink($exceptionHandlerFile);
653
            if ($deleted) {
654
                file_put_contents($exceptionHandlerFile, $exceptionHandlerFileContentNew);
655
            }
656
        }
657
658
        $exceptionHandlerGuardContentNew = file_get_contents(__DIR__ . '/../Stubs/Exceptions/handlerGuard.stub');
659
        $exceptionHandlerGuardContentNew2 = str_replace('{{$nameSmall}}', "$nameSmall",