mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-24 16:40:30 +00:00
Cleanup
This commit is contained in:
parent
864c1dd23a
commit
001cc7168a
7 changed files with 6 additions and 29 deletions
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -234,8 +234,6 @@ class ConfigController extends Controller
|
|||
*/
|
||||
public function resetAction($type)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
switch ($type) {
|
||||
case 'annotations':
|
||||
$this->getDoctrine()
|
||||
|
|
|
@ -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'])) {
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
@ -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'));
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue