Code Duplication    Length = 7-7 lines in 2 locations

src/Plugins/ServiceProviderRegister.php 2 locations

@@ 40-46 (lines=7) @@
37
        $qualifiedName = $this->attributes['qualified_name'];
38
        $class = $this->attributes['class'];
39
40
        if ($qualifiedName && strpos($content, sprintf('use %s;', $qualifiedName)) === false) {
41
            $content = preg_replace_callback(
42
                '/namespace.+/',
43
                [$this, 'replaceServieProviderCallback'],
44
                $content
45
            );
46
        }
47
48
        if ($class && strpos($content, sprintf('$this->app->singleton(%sContract::class, %s::class);', $class, $class)) === false) {
49
            $content = preg_replace_callback(
@@ 48-54 (lines=7) @@
45
            );
46
        }
47
48
        if ($class && strpos($content, sprintf('$this->app->singleton(%sContract::class, %s::class);', $class, $class)) === false) {
49
            $content = preg_replace_callback(
50
                '/protected function registerRepositories.+\n\s+{/',
51
                [$this, 'replaceServieProviderCallback'],
52
                $content
53
            );
54
        }
55
56
        $this->files->put($path, $this->useSortFixer->fix($content));
57
    }