From a0766fc4cee43bf89d0738881dd218220c9c431d Mon Sep 17 00:00:00 2001 From: Jacob Tobiasz Date: Mon, 22 Apr 2024 14:55:31 +0200 Subject: [PATCH 1/2] [Maintenance] Move test-app related files into its own `app/`directory --- {src => app}/Kernel.php | 0 composer.json | 4 +--- config/services.yaml | 27 +++++++++++++++++++++++++-- 3 files changed, 26 insertions(+), 5 deletions(-) rename {src => app}/Kernel.php (100%) diff --git a/src/Kernel.php b/app/Kernel.php similarity index 100% rename from src/Kernel.php rename to app/Kernel.php diff --git a/composer.json b/composer.json index 2d7dd2d5..9a88714c 100644 --- a/composer.json +++ b/composer.json @@ -50,10 +50,8 @@ } }, "autoload-dev": { - "classmap": [ - "src/Kernel.php" - ], "psr-4": { + "App\\": "app/", "TestApplication\\Sylius\\TwigHooks\\": "src/TwigHooks/tests/Functional/.application/src/", "Tests\\Sylius\\TwigHooks\\": "src/TwigHooks/tests/" } diff --git a/config/services.yaml b/config/services.yaml index 4ce82786..789703ca 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -1,6 +1,29 @@ +# Put parameters here that don't need to change on each machine where the app is deployed +# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration parameters: + locale: en_US services: + # Default configuration for services in *this* file _defaults: - autowire: false - autoconfigure: false + # Automatically injects dependencies in your services + autowire: true + + # Automatically registers your services as commands, event subscribers, etc. + autoconfigure: true + + # Allows optimizing the container by removing unused services; this also means + # fetching services directly from the container via $container->get() won't work + public: false + + # Makes classes in src/ available to be used as services; + # this creates a service per class whose id is the fully-qualified class name + App\: + resource: '../app/*' + exclude: '../app/{Entity,Migrations,Tests,Kernel.php}' + + # Controllers are imported separately to make sure services can be injected + # as action arguments even if you don't extend any base controller class +# App\Controller\: +# resource: '../src/Controller' +# tags: ['controller.service_arguments'] From c3e633d62369d680e595bf4c82a73287ce4fee0a Mon Sep 17 00:00:00 2001 From: Jacob Tobiasz Date: Tue, 23 Apr 2024 07:09:08 +0200 Subject: [PATCH 2/2] [Maintenance] Fix direct and indirect deprecations --- config/packages/twig.yaml | 3 +++ .../.application/config/packages/framework.php | 13 +++++++++++++ .../config/packages/twig_component.yaml | 4 ++++ 3 files changed, 20 insertions(+) create mode 100644 src/TwigHooks/tests/Functional/.application/config/packages/framework.php create mode 100644 src/TwigHooks/tests/Functional/.application/config/packages/twig_component.yaml diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index f9f4cc53..f299b5cb 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -1,6 +1,9 @@ twig: default_path: '%kernel.project_dir%/templates' +twig_component: + anonymous_template_directory: 'components/' + when@test: twig: strict_variables: true diff --git a/src/TwigHooks/tests/Functional/.application/config/packages/framework.php b/src/TwigHooks/tests/Functional/.application/config/packages/framework.php new file mode 100644 index 00000000..cb7eff64 --- /dev/null +++ b/src/TwigHooks/tests/Functional/.application/config/packages/framework.php @@ -0,0 +1,13 @@ += 6) { + $container->extension('framework', [ + 'handle_all_throwables' => true, + ]); + } +}; diff --git a/src/TwigHooks/tests/Functional/.application/config/packages/twig_component.yaml b/src/TwigHooks/tests/Functional/.application/config/packages/twig_component.yaml new file mode 100644 index 00000000..810c72cb --- /dev/null +++ b/src/TwigHooks/tests/Functional/.application/config/packages/twig_component.yaml @@ -0,0 +1,4 @@ +twig_component: + anonymous_template_directory: 'components/' + defaults: + App\Twig\Component\: 'components/'