Use FQCN as service name for Import services

This commit is contained in:
Yassine Guedidi
2022-04-24 16:58:37 +02:00
parent 4449265836
commit a7addd3c13
15 changed files with 70 additions and 51 deletions

View File

@ -4,6 +4,7 @@ namespace Wallabag\ImportBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Wallabag\ImportBundle\Import\ChromeImport;
class ChromeController extends BrowserController
{
@ -20,7 +21,7 @@ class ChromeController extends BrowserController
*/
protected function getImportService()
{
$service = $this->get('wallabag_import.chrome.import');
$service = $this->get(ChromeImport::class);
if ($this->get('craue_config')->get('import_with_rabbitmq')) {
$service->setProducer($this->get('old_sound_rabbit_mq.import_chrome_producer'));

View File

@ -6,6 +6,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Wallabag\ImportBundle\Form\Type\UploadImportType;
use Wallabag\ImportBundle\Import\DeliciousImport;
class DeliciousController extends Controller
{
@ -17,7 +18,7 @@ class DeliciousController extends Controller
$form = $this->createForm(UploadImportType::class);
$form->handleRequest($request);
$delicious = $this->get('wallabag_import.delicious.import');
$delicious = $this->get(DeliciousImport::class);
$delicious->setUser($this->getUser());
if ($this->get('craue_config')->get('import_with_rabbitmq')) {

View File

@ -4,6 +4,7 @@ namespace Wallabag\ImportBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Wallabag\ImportBundle\Import\ElcuratorImport;
class ElcuratorController extends WallabagController
{
@ -20,7 +21,7 @@ class ElcuratorController extends WallabagController
*/
protected function getImportService()
{
$service = $this->get('wallabag_import.elcurator.import');
$service = $this->get(ElcuratorImport::class);
if ($this->get('craue_config')->get('import_with_rabbitmq')) {
$service->setProducer($this->get('old_sound_rabbit_mq.import_elcurator_producer'));

View File

@ -4,6 +4,7 @@ namespace Wallabag\ImportBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Wallabag\ImportBundle\Import\FirefoxImport;
class FirefoxController extends BrowserController
{
@ -20,7 +21,7 @@ class FirefoxController extends BrowserController
*/
protected function getImportService()
{
$service = $this->get('wallabag_import.firefox.import');
$service = $this->get(FirefoxImport::class);
if ($this->get('craue_config')->get('import_with_rabbitmq')) {
$service->setProducer($this->get('old_sound_rabbit_mq.import_firefox_producer'));

View File

@ -6,6 +6,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Wallabag\ImportBundle\Form\Type\UploadImportType;
use Wallabag\ImportBundle\Import\InstapaperImport;
class InstapaperController extends Controller
{
@ -17,7 +18,7 @@ class InstapaperController extends Controller
$form = $this->createForm(UploadImportType::class);
$form->handleRequest($request);
$instapaper = $this->get('wallabag_import.instapaper.import');
$instapaper = $this->get(InstapaperImport::class);
$instapaper->setUser($this->getUser());
if ($this->get('craue_config')->get('import_with_rabbitmq')) {

View File

@ -6,6 +6,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Wallabag\ImportBundle\Form\Type\UploadImportType;
use Wallabag\ImportBundle\Import\PinboardImport;
class PinboardController extends Controller
{
@ -17,7 +18,7 @@ class PinboardController extends Controller
$form = $this->createForm(UploadImportType::class);
$form->handleRequest($request);
$pinboard = $this->get('wallabag_import.pinboard.import');
$pinboard = $this->get(PinboardImport::class);
$pinboard->setUser($this->getUser());
if ($this->get('craue_config')->get('import_with_rabbitmq')) {

View File

@ -7,6 +7,7 @@ use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Wallabag\ImportBundle\Import\PocketImport;
class PocketController extends Controller
{
@ -110,7 +111,7 @@ class PocketController extends Controller
*/
private function getPocketImportService()
{
$pocket = $this->get('wallabag_import.pocket.import');
$pocket = $this->get(PocketImport::class);
$pocket->setUser($this->getUser());
if ($this->get('craue_config')->get('import_with_rabbitmq')) {

View File

@ -6,6 +6,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Wallabag\ImportBundle\Form\Type\UploadImportType;
use Wallabag\ImportBundle\Import\ReadabilityImport;
class ReadabilityController extends Controller
{
@ -17,7 +18,7 @@ class ReadabilityController extends Controller
$form = $this->createForm(UploadImportType::class);
$form->handleRequest($request);
$readability = $this->get('wallabag_import.readability.import');
$readability = $this->get(ReadabilityImport::class);
$readability->setUser($this->getUser());
if ($this->get('craue_config')->get('import_with_rabbitmq')) {

View File

@ -4,6 +4,7 @@ namespace Wallabag\ImportBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Wallabag\ImportBundle\Import\WallabagV1Import;
class WallabagV1Controller extends WallabagController
{
@ -20,7 +21,7 @@ class WallabagV1Controller extends WallabagController
*/
protected function getImportService()
{
$service = $this->get('wallabag_import.wallabag_v1.import');
$service = $this->get(WallabagV1Import::class);
if ($this->get('craue_config')->get('import_with_rabbitmq')) {
$service->setProducer($this->get('old_sound_rabbit_mq.import_wallabag_v1_producer'));

View File

@ -4,6 +4,7 @@ namespace Wallabag\ImportBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Wallabag\ImportBundle\Import\WallabagV2Import;
class WallabagV2Controller extends WallabagController
{
@ -20,7 +21,7 @@ class WallabagV2Controller extends WallabagController
*/
protected function getImportService()
{
$service = $this->get('wallabag_import.wallabag_v2.import');
$service = $this->get(WallabagV2Import::class);
if ($this->get('craue_config')->get('import_with_rabbitmq')) {
$service->setProducer($this->get('old_sound_rabbit_mq.import_wallabag_v2_producer'));