]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Cleanup
authorJeremy Benoist <jeremy.benoist@gmail.com>
Thu, 3 Nov 2016 17:01:25 +0000 (18:01 +0100)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Thu, 3 Nov 2016 17:01:25 +0000 (18:01 +0100)
src/Wallabag/ApiBundle/Controller/TagRestController.php
src/Wallabag/ApiBundle/Controller/WallabagRestController.php
src/Wallabag/CoreBundle/Controller/ConfigController.php
src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php
src/Wallabag/CoreBundle/Helper/DownloadImages.php
src/Wallabag/ImportBundle/Command/ImportCommand.php
src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php

index 4e7ddc6621baadfa2d756f4495b49e25a2cb6189..bc6d4e6499cf0f6edd7aeb05e67ef5e7a174653e 100644 (file)
@@ -131,22 +131,6 @@ class TagRestController extends WallabagRestController
         return (new JsonResponse())->setJson($json);
     }
 
-    /**
-     * Retrieve version number.
-     *
-     * @ApiDoc()
-     *
-     * @return JsonResponse
-     */
-    public function getVersionAction()
-    {
-        $version = $this->container->getParameter('wallabag_core.version');
-
-        $json = $this->get('serializer')->serialize($version, 'json');
-
-        return (new JsonResponse())->setJson($json);
-    }
-
     /**
      * Remove orphan tag in case no entries are associated to it.
      *
index 1ff593f504c007eef40d59482419f7140f0180c5..b1e08ca441a00c578d6939cf5455728bc2035460 100644 (file)
@@ -3,10 +3,9 @@
 namespace Wallabag\ApiBundle\Controller;
 
 use FOS\RestBundle\Controller\FOSRestController;
-use Symfony\Component\Security\Core\Exception\AccessDeniedException;
-use Wallabag\CoreBundle\Entity\Entry;
 use Nelmio\ApiDocBundle\Annotation\ApiDoc;
 use Symfony\Component\HttpFoundation\JsonResponse;
+use Symfony\Component\Security\Core\Exception\AccessDeniedException;
 
 class WallabagRestController extends FOSRestController
 {
index d40efcd73cfe5bf88845af30e29072d915677b79..fe81771116f128a7d540a8c83907e9bef0e2a909 100644 (file)
@@ -234,8 +234,6 @@ class ConfigController extends Controller
      */
     public function resetAction($type)
     {
-        $em = $this->getDoctrine()->getManager();
-
         switch ($type) {
             case 'annotations':
                 $this->getDoctrine()
index 9013328f152e1fb9b2bbcfe32119e21caae454ac..711c3bf8a5c55ebd291af4bad1ef163b6c2d617e 100644 (file)
@@ -39,7 +39,7 @@ class TablePrefixSubscriber implements EventSubscriber
             return;
         }
 
-        $classMetadata->setTableName($this->prefix.$classMetadata->getTableName());
+        $classMetadata->setPrimaryTable(['name' => $this->prefix.$classMetadata->getTableName()]);
 
         foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) {
             if ($mapping['type'] === ClassMetadataInfo::MANY_TO_MANY && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name'])) {
index c5298236a4f0159e4ba85d46a8d6b9c0cf7ff744..264bc6a3eba7cb30ddedcad79821de83dac8341a 100644 (file)
@@ -135,16 +135,16 @@ class DownloadImages
 
         switch ($ext) {
             case 'gif':
-                $result = imagegif($im, $localPath);
+                imagegif($im, $localPath);
                 $this->logger->debug('DownloadImages: Re-creating gif');
                 break;
             case 'jpeg':
             case 'jpg':
-                $result = imagejpeg($im, $localPath, self::REGENERATE_PICTURES_QUALITY);
+                imagejpeg($im, $localPath, self::REGENERATE_PICTURES_QUALITY);
                 $this->logger->debug('DownloadImages: Re-creating jpg');
                 break;
             case 'png':
-                $result = imagepng($im, $localPath, ceil(self::REGENERATE_PICTURES_QUALITY / 100 * 9));
+                imagepng($im, $localPath, ceil(self::REGENERATE_PICTURES_QUALITY / 100 * 9));
                 $this->logger->debug('DownloadImages: Re-creating png');
         }
 
index 13f3dcb994dbf54899356919fcb119f50ee78187..e423ffae579106b99e6360b280fc4b68042ec084 100644 (file)
@@ -56,13 +56,8 @@ class ImportCommand extends ContainerAwareCommand
             case 'instapaper':
                 $import = $this->getContainer()->get('wallabag_import.instapaper.import');
                 break;
-            case 'instapaper':
-                $wallabag = $this->getContainer()->get('wallabag_import.instapaper.import');
-                break;
-            case 'v1':
             default:
                 $import = $this->getContainer()->get('wallabag_import.wallabag_v1.import');
-                break;
         }
 
         $import->setMarkAsRead($input->getOption('markAsRead'));
index aa7ff9144a121aa4f915320da9f29cdce3204d1b..fc175f671b466b8370dbd7e6ea0878358b9d6873 100644 (file)
@@ -17,6 +17,7 @@ abstract class AbstractConsumer
     protected $em;
     protected $userRepository;
     protected $import;
+    protected $eventDispatcher;
     protected $logger;
 
     public function __construct(EntityManager $em, UserRepository $userRepository, AbstractImport $import, EventDispatcherInterface $eventDispatcher, LoggerInterface $logger = null)