diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7bb751d6c..759cf16ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,8 +18,12 @@ jobs: fail-fast: false matrix: php: ["8.0", "8.1"] - symfony: ["^5.4", "^6.0"] + symfony: ["^5.4", "~6.0.0", "~6.1.0"] twig: ["^2.12", "^3.0"] + exclude: + - + php: "8.0" + symfony: "~6.1.0" steps: - diff --git a/src/Bundle/DependencyInjection/Compiler/CsrfTokenManagerPass.php b/src/Bundle/DependencyInjection/Compiler/CsrfTokenManagerPass.php new file mode 100644 index 000000000..e1bee4836 --- /dev/null +++ b/src/Bundle/DependencyInjection/Compiler/CsrfTokenManagerPass.php @@ -0,0 +1,33 @@ +hasDefinition('security.csrf.token_manager')) { + return; + } + + $csrdTokenManagerDefinition = $container->getDefinition('security.csrf.token_manager'); + $csrdTokenManagerDefinition->setPublic(true); + } +} diff --git a/src/Bundle/SyliusResourceBundle.php b/src/Bundle/SyliusResourceBundle.php index f5ee44478..55136b581 100644 --- a/src/Bundle/SyliusResourceBundle.php +++ b/src/Bundle/SyliusResourceBundle.php @@ -13,6 +13,7 @@ namespace Sylius\Bundle\ResourceBundle; +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\Helper\TargetEntitiesResolver; @@ -41,15 +42,16 @@ public function build(ContainerBuilder $container): void { parent::build($container); - $container->addCompilerPass(new WinzouStateMachinePass()); - $container->addCompilerPass(new RegisterStateMachinePass()); - $container->addCompilerPass(new RegisterResourcesPass()); - $container->addCompilerPass(new RegisterFqcnControllersPass()); - $container->addCompilerPass(new DoctrineTargetEntitiesResolverPass(new TargetEntitiesResolver()), PassConfig::TYPE_BEFORE_OPTIMIZATION, 1); + $container->addCompilerPass(new CsrfTokenManagerPass()); $container->addCompilerPass(new DoctrineContainerRepositoryFactoryPass()); - $container->addCompilerPass(new RegisterResourceRepositoryPass()); + $container->addCompilerPass(new DoctrineTargetEntitiesResolverPass(new TargetEntitiesResolver()), PassConfig::TYPE_BEFORE_OPTIMIZATION, 1); $container->addCompilerPass(new RegisterFormBuilderPass()); + $container->addCompilerPass(new RegisterFqcnControllersPass()); + $container->addCompilerPass(new RegisterResourceRepositoryPass()); + $container->addCompilerPass(new RegisterResourcesPass()); + $container->addCompilerPass(new RegisterStateMachinePass()); $container->addCompilerPass(new TwigPass()); + $container->addCompilerPass(new WinzouStateMachinePass()); $container->registerExtension(new PagerfantaExtension(true)); $container->addCompilerPass(new PagerfantaBridgePass(true), PassConfig::TYPE_BEFORE_OPTIMIZATION, -1); // Should run after all passes from BabDevPagerfantaBundle diff --git a/src/Bundle/test/src/Tests/Controller/ScienceBookUiTest.php b/src/Bundle/test/src/Tests/Controller/ScienceBookUiTest.php index 497a6de83..843510945 100644 --- a/src/Bundle/test/src/Tests/Controller/ScienceBookUiTest.php +++ b/src/Bundle/test/src/Tests/Controller/ScienceBookUiTest.php @@ -48,11 +48,11 @@ public function it_allows_indexing_books(): void $content = $response->getContent(); $this->assertStringContainsString('