anime-db / catalog-bundle

Catalog anime
GNU General Public License v3.0
0 stars 1 forks source link

[Insight] Code should not be duplicated - in src/Controller/InstallController.php, line 174 #209

Closed peter-gribanov closed 9 years ago

peter-gribanov commented 9 years ago

in src/Controller/InstallController.php, line 174

The next 24 lines appear both in src/Controller/InstallController.php:174 and src/Controller/StorageController.php:194.

        $storage = $this->getDoctrine()->getRepository('AnimeDbCatalogBundle:Storage')->getLast();
        if (!$storage) {
            return $this->redirect('install_add_storage');
        }

        $response = $this->get('cache_time_keeper')->getResponse($storage->getDateUpdate());

        $scan_output = $this->container->getParameter('anime_db.catalog.storage.scan_output');
        $scan_output = sprintf($scan_output, $storage->getId());
        if (!is_dir($dir = pathinfo($scan_output, PATHINFO_DIRNAME))) {
            if (true !== @mkdir($dir, 0755, true)) {

Posted from SensioLabsInsight