Skip to content

Commit

Permalink
Rename compiler passes
Browse files Browse the repository at this point in the history
  • Loading branch information
loic425 committed May 23, 2024
1 parent 472bfea commit 10e80cf
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

final class FosRestPass implements CompilerPassInterface
final class UnregisterFosRestDefinitionsPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

final class HateoasPass implements CompilerPassInterface
final class UnregisterHateoasDefinitionsPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
Expand Down
8 changes: 4 additions & 4 deletions src/Bundle/SyliusResourceBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\CsrfTokenManagerPass;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\DoctrineContainerRepositoryFactoryPass;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\DoctrineTargetEntitiesResolverPass;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\FosRestPass;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\HateoasPass;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\Helper\TargetEntitiesResolver;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\PagerfantaBridgePass;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\RegisterFormBuilderPass;
Expand All @@ -27,6 +25,8 @@
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\RegisterResourceStateMachinePass;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\RegisterStateMachinePass;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\TwigPass;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\UnregisterFosRestDefinitionsPass;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\UnregisterHateoasDefinitionsPass;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\WinzouStateMachinePass;
use Sylius\Bundle\ResourceBundle\DependencyInjection\PagerfantaExtension;
use Sylius\Resource\Symfony\DependencyIjection\Compiler\DisableMetadataCachePass;
Expand All @@ -52,14 +52,14 @@ public function build(ContainerBuilder $container): void
$container->addCompilerPass(new DisableMetadataCachePass());
$container->addCompilerPass(new DoctrineContainerRepositoryFactoryPass());
$container->addCompilerPass(new DoctrineTargetEntitiesResolverPass(new TargetEntitiesResolver()), PassConfig::TYPE_BEFORE_OPTIMIZATION, 1);
$container->addCompilerPass(new FosRestPass());
$container->addCompilerPass(new HateoasPass());
$container->addCompilerPass(new RegisterFormBuilderPass());
$container->addCompilerPass(new RegisterFqcnControllersPass());
$container->addCompilerPass(new RegisterResourceRepositoryPass());
$container->addCompilerPass(new RegisterResourcesPass());
$container->addCompilerPass(new RegisterStateMachinePass());
$container->addCompilerPass(new RegisterResourceStateMachinePass());
$container->addCompilerPass(new UnregisterFosRestDefinitionsPass());
$container->addCompilerPass(new UnregisterHateoasDefinitionsPass());
$container->addCompilerPass(new TwigPass());
$container->addCompilerPass(new WinzouStateMachinePass());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
use FOS\RestBundle\FOSRestBundle;
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractCompilerPassTestCase;
use Sylius\Bundle\ResourceBundle\Controller\ViewHandler;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\FosRestPass;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\UnregisterFosRestDefinitionsPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;

final class FosRestPassTest extends AbstractCompilerPassTestCase
final class UnregisterFosRestDefinitionsPassTest extends AbstractCompilerPassTestCase
{
/** @test */
public function it_remove_view_handler_if_fos_rest_is_not_available(): void
Expand All @@ -46,6 +46,6 @@ protected function registerCompilerPass(ContainerBuilder $container): void
$this->registerService('sylius.resource_controller.view_handler', ViewHandler::class);
$this->setParameter('kernel.bundles', []);

$container->addCompilerPass(new FosRestPass());
$container->addCompilerPass(new UnregisterFosRestDefinitionsPass());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
use Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle;
use Hateoas\Representation\Factory\PagerfantaFactory;
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractCompilerPassTestCase;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\HateoasPass;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\UnregisterHateoasDefinitionsPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;

final class HateoasPassTest extends AbstractCompilerPassTestCase
final class UnregisterHateoasDefinitionsPassTest extends AbstractCompilerPassTestCase
{
/** @test */
public function it_remove_pagerfanta_representation_factory_if_hateoas_is_not_available(): void
Expand All @@ -46,6 +46,6 @@ protected function registerCompilerPass(ContainerBuilder $container): void
$this->registerService('sylius.resource_controller.pagerfanta_representation_factory', PagerfantaFactory::class);
$this->setParameter('kernel.bundles', []);

$container->addCompilerPass(new HateoasPass());
$container->addCompilerPass(new UnregisterHateoasDefinitionsPass());
}
}

0 comments on commit 10e80cf

Please sign in to comment.