1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-26 18:21:02 +00:00

Use FQCN instead of service alias

This commit is contained in:
Yassine Guedidi 2022-08-28 02:01:46 +02:00
parent 156158673f
commit eb43c78720
62 changed files with 579 additions and 404 deletions

View file

@ -2,9 +2,12 @@
namespace Wallabag\ImportBundle\Controller;
use Craue\ConfigBundle\Util\Config;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Translation\TranslatorInterface;
use Wallabag\ImportBundle\Form\Type\UploadImportType;
use Wallabag\ImportBundle\Import\InstapaperImport;
@ -21,9 +24,9 @@ class InstapaperController extends Controller
$instapaper = $this->get(InstapaperImport::class);
$instapaper->setUser($this->getUser());
if ($this->get('craue_config')->get('import_with_rabbitmq')) {
if ($this->get(Config::class)->get('import_with_rabbitmq')) {
$instapaper->setProducer($this->get('old_sound_rabbit_mq.import_instapaper_producer'));
} elseif ($this->get('craue_config')->get('import_with_redis')) {
} elseif ($this->get(Config::class)->get('import_with_redis')) {
$instapaper->setProducer($this->get('wallabag_import.producer.redis.instapaper'));
}
@ -42,13 +45,13 @@ class InstapaperController extends Controller
if (true === $res) {
$summary = $instapaper->getSummary();
$message = $this->get('translator')->trans('flashes.import.notice.summary', [
$message = $this->get(TranslatorInterface::class)->trans('flashes.import.notice.summary', [
'%imported%' => $summary['imported'],
'%skipped%' => $summary['skipped'],
]);
if (0 < $summary['queued']) {
$message = $this->get('translator')->trans('flashes.import.notice.summary_with_queue', [
$message = $this->get(TranslatorInterface::class)->trans('flashes.import.notice.summary_with_queue', [
'%queued%' => $summary['queued'],
]);
}
@ -56,7 +59,7 @@ class InstapaperController extends Controller
unlink($this->getParameter('wallabag_import.resource_dir') . '/' . $name);
}
$this->get('session')->getFlashBag()->add(
$this->get(SessionInterface::class)->getFlashBag()->add(
'notice',
$message
);
@ -64,7 +67,7 @@ class InstapaperController extends Controller
return $this->redirect($this->generateUrl('homepage'));
}
$this->get('session')->getFlashBag()->add(
$this->get(SessionInterface::class)->getFlashBag()->add(
'notice',
'flashes.import.notice.failed_on_file'
);