Code Duplication    Length = 7-7 lines in 2 locations

Generator/AdminGenerator.php 1 location

@@ 59-65 (lines=7) @@
56
        $this->file = sprintf('%s/Admin/%s.php', $bundle->getPath(), str_replace('\\', '/', $adminClassBasename));
57
        $parts = explode('\\', $this->class);
58
59
        if (file_exists($this->file)) {
60
            throw new \RuntimeException(sprintf(
61
                'Unable to generate the admin class "%s". The file "%s" already exists.',
62
                $this->class,
63
                realpath($this->file)
64
            ));
65
        }
66
67
        // Manage route pattern generation
68
        $routes = $parts;

Generator/ControllerGenerator.php 1 location

@@ 57-63 (lines=7) @@
54
        );
55
        $parts = explode('\\', $this->class);
56
57
        if (file_exists($this->file)) {
58
            throw new \RuntimeException(sprintf(
59
                'Unable to generate the admin controller class "%s". The file "%s" already exists.',
60
                $this->class,
61
                realpath($this->file)
62
            ));
63
        }
64
65
        $this->renderFile('AdminController.php.twig', $this->file, array(
66
            'classBasename' => array_pop($parts),