diff --git a/src/Wallabag/ImportBundle/Controller/ImportController.php b/src/Wallabag/ImportBundle/Controller/ImportController.php index 774017b9c..bf6344bb3 100644 --- a/src/Wallabag/ImportBundle/Controller/ImportController.php +++ b/src/Wallabag/ImportBundle/Controller/ImportController.php @@ -4,6 +4,7 @@ namespace Wallabag\ImportBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\Routing\Annotation\Route; +use Wallabag\ImportBundle\Import\ImportChain; class ImportController extends Controller { @@ -13,7 +14,7 @@ class ImportController extends Controller public function importAction() { return $this->render('WallabagImportBundle:Import:index.html.twig', [ - 'imports' => $this->get('wallabag_import.chain')->getAll(), + 'imports' => $this->get(ImportChain::class)->getAll(), ]); } diff --git a/src/Wallabag/ImportBundle/Import/ImportCompilerPass.php b/src/Wallabag/ImportBundle/Import/ImportCompilerPass.php index d7df0a83c..ff23bd19f 100644 --- a/src/Wallabag/ImportBundle/Import/ImportCompilerPass.php +++ b/src/Wallabag/ImportBundle/Import/ImportCompilerPass.php @@ -10,12 +10,12 @@ class ImportCompilerPass implements CompilerPassInterface { public function process(ContainerBuilder $container) { - if (!$container->hasDefinition('wallabag_import.chain')) { + if (!$container->hasDefinition(ImportChain::class)) { return; } $definition = $container->getDefinition( - 'wallabag_import.chain' + ImportChain::class ); $taggedServices = $container->findTaggedServiceIds( diff --git a/src/Wallabag/ImportBundle/Resources/config/services.yml b/src/Wallabag/ImportBundle/Resources/config/services.yml index 5258fa62b..748893a4c 100644 --- a/src/Wallabag/ImportBundle/Resources/config/services.yml +++ b/src/Wallabag/ImportBundle/Resources/config/services.yml @@ -3,7 +3,7 @@ imports: - { resource: redis.yml } services: - wallabag_import.chain: + Wallabag\ImportBundle\Import\ImportChain: class: Wallabag\ImportBundle\Import\ImportChain wallabag_import.pocket.client: diff --git a/tests/Wallabag/ImportBundle/Import/ImportCompilerPassTest.php b/tests/Wallabag/ImportBundle/Import/ImportCompilerPassTest.php index e0e90ae3e..e77ffc9f0 100644 --- a/tests/Wallabag/ImportBundle/Import/ImportCompilerPassTest.php +++ b/tests/Wallabag/ImportBundle/Import/ImportCompilerPassTest.php @@ -4,6 +4,7 @@ namespace Tests\Wallabag\ImportBundle\Import; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ContainerBuilder; +use Wallabag\ImportBundle\Import\ImportChain; use Wallabag\ImportBundle\Import\ImportCompilerPass; class ImportCompilerPassTest extends TestCase @@ -20,7 +21,7 @@ class ImportCompilerPassTest extends TestCase { $container = new ContainerBuilder(); $container - ->register('wallabag_import.chain') + ->register(ImportChain::class) ->setPublic(false) ; @@ -31,9 +32,9 @@ class ImportCompilerPassTest extends TestCase $this->process($container); - $this->assertTrue($container->hasDefinition('wallabag_import.chain')); + $this->assertTrue($container->hasDefinition(ImportChain::class)); - $definition = $container->getDefinition('wallabag_import.chain'); + $definition = $container->getDefinition(ImportChain::class); $this->assertTrue($definition->hasMethodCall('addImport')); $calls = $definition->getMethodCalls();