From 5360772aaff33e82c4760b54b4ee459af52bc3e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pysiak?= Date: Fri, 27 Sep 2024 06:09:00 +0200 Subject: [PATCH 1/6] Remove dependecies --- composer.json | 3 +-- config/bundles.php | 1 - config/packages/fos_rest.yaml | 11 ----------- config/packages/test_cached/fos_rest.yaml | 3 --- .../bundles/SyliusAddressingBundle/installation.rst | 1 - .../bundles/SyliusAttributeBundle/installation.rst | 1 - .../bundles/SyliusCustomerBundle/installation.rst | 1 - .../bundles/SyliusInventoryBundle/installation.rst | 1 - .../bundles/SyliusOrderBundle/installation.rst | 1 - .../bundles/SyliusProductBundle/installation.rst | 1 - .../bundles/SyliusPromotionBundle/installation.rst | 1 - .../bundles/SyliusShippingBundle/installation.rst | 1 - .../bundles/SyliusTaxationBundle/installation.rst | 1 - .../bundles/SyliusTaxonomyBundle/installation.rst | 1 - .../bundles/SyliusUserBundle/installation.rst | 1 - .../configuration/disabling-shop-admin-api.rst | 9 --------- src/Sylius/Bundle/AddressingBundle/composer.json | 1 - .../Bundle/AddressingBundle/test/app/AppKernel.php | 1 - .../Bundle/AdminBundle/test/config/bundles.php | 1 - src/Sylius/Bundle/AttributeBundle/composer.json | 1 - .../Bundle/AttributeBundle/test/app/AppKernel.php | 1 - src/Sylius/Bundle/ChannelBundle/composer.json | 1 - .../Bundle/ChannelBundle/test/app/AppKernel.php | 1 - .../Bundle/ChannelBundle/test/app/config/config.yml | 9 --------- src/Sylius/Bundle/CurrencyBundle/composer.json | 1 - .../Bundle/CurrencyBundle/test/app/AppKernel.php | 1 - src/Sylius/Bundle/CustomerBundle/composer.json | 1 - .../Bundle/CustomerBundle/test/app/AppKernel.php | 1 - src/Sylius/Bundle/InventoryBundle/composer.json | 1 - .../Bundle/InventoryBundle/test/app/AppKernel.php | 1 - src/Sylius/Bundle/LocaleBundle/composer.json | 1 - .../Bundle/LocaleBundle/test/app/AppKernel.php | 1 - src/Sylius/Bundle/MoneyBundle/composer.json | 1 - src/Sylius/Bundle/MoneyBundle/test/app/AppKernel.php | 1 - src/Sylius/Bundle/OrderBundle/composer.json | 1 - src/Sylius/Bundle/OrderBundle/test/app/AppKernel.php | 1 - .../Bundle/OrderBundle/test/app/config/config.yml | 9 --------- src/Sylius/Bundle/PaymentBundle/composer.json | 1 - .../Bundle/PaymentBundle/test/app/AppKernel.php | 1 - src/Sylius/Bundle/ProductBundle/composer.json | 1 - .../Bundle/ProductBundle/test/app/AppKernel.php | 1 - src/Sylius/Bundle/PromotionBundle/composer.json | 1 - .../Bundle/PromotionBundle/test/app/AppKernel.php | 1 - src/Sylius/Bundle/ReviewBundle/composer.json | 1 - .../Bundle/ReviewBundle/test/app/AppKernel.php | 1 - .../Bundle/ReviewBundle/test/app/config/config.yml | 9 --------- src/Sylius/Bundle/ShippingBundle/composer.json | 1 - .../Bundle/ShippingBundle/test/app/AppKernel.php | 1 - .../Bundle/ShippingBundle/test/app/config/config.yml | 9 --------- src/Sylius/Bundle/TaxationBundle/composer.json | 1 - .../Bundle/TaxationBundle/test/app/AppKernel.php | 1 - .../Tests/Functional/app/AppKernel.php | 1 - src/Sylius/Bundle/TaxonomyBundle/composer.json | 1 - .../UserBundle/Tests/Functional/app/AppKernel.php | 1 - src/Sylius/Bundle/UserBundle/composer.json | 1 - src/Sylius/Component/Addressing/composer.json | 2 +- src/Sylius/Component/Attribute/composer.json | 2 +- src/Sylius/Component/Channel/composer.json | 2 +- src/Sylius/Component/Core/composer.json | 2 +- src/Sylius/Component/Currency/composer.json | 2 +- src/Sylius/Component/Customer/composer.json | 2 +- src/Sylius/Component/Inventory/composer.json | 2 +- src/Sylius/Component/Locale/composer.json | 2 +- src/Sylius/Component/Order/composer.json | 2 +- src/Sylius/Component/Payment/composer.json | 2 +- src/Sylius/Component/Product/composer.json | 2 +- src/Sylius/Component/Promotion/composer.json | 2 +- src/Sylius/Component/Review/composer.json | 2 +- src/Sylius/Component/Shipping/composer.json | 2 +- src/Sylius/Component/Taxation/composer.json | 2 +- src/Sylius/Component/Taxonomy/composer.json | 2 +- src/Sylius/Component/User/composer.json | 2 +- symfony.lock | 12 ------------ 73 files changed, 18 insertions(+), 137 deletions(-) delete mode 100644 config/packages/fos_rest.yaml delete mode 100644 config/packages/test_cached/fos_rest.yaml diff --git a/composer.json b/composer.json index 85d2ba91b8..94d7b8b8ec 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,6 @@ "enshrined/svg-sanitize": "^0.16", "fakerphp/faker": "^1.10", "friendsofphp/proxy-manager-lts": "^1.0.7", - "friendsofsymfony/rest-bundle": "^3.0", "gedmo/doctrine-extensions": "^3.2", "guzzlehttp/guzzle": "^6.5 || ^7.0", "guzzlehttp/psr7": "^2.5", @@ -82,7 +81,7 @@ "sylius/mailer": "^2.0", "sylius/mailer-bundle": "^2.0 || ^2.1@alpha", "sylius/registry": "^1.6", - "sylius/resource": "^1.11 || ^1.12@alpha", + "sylius/resource": "^1.12@alpha", "sylius/resource-bundle": "^1.11 || ^1.12@alpha", "sylius/theme-bundle": "^2.3", "sylius/twig-hooks": "~0.3.0", diff --git a/config/bundles.php b/config/bundles.php index 09681d0f12..f4ed614387 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -32,7 +32,6 @@ return [ winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class => ['all' => true], Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true], JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true], - FOS\RestBundle\FOSRestBundle::class => ['all' => true], Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true], Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true], League\FlysystemBundle\FlysystemBundle::class => ['all' => true], diff --git a/config/packages/fos_rest.yaml b/config/packages/fos_rest.yaml deleted file mode 100644 index eaebb27760..0000000000 --- a/config/packages/fos_rest.yaml +++ /dev/null @@ -1,11 +0,0 @@ -fos_rest: - exception: true - view: - formats: - json: true - xml: true - empty_content: 204 - format_listener: - rules: - - { path: '^/api/v1/.*', priorities: ['json', 'xml'], fallback_format: json, prefer_extension: true } - - { path: '^/', stop: true } diff --git a/config/packages/test_cached/fos_rest.yaml b/config/packages/test_cached/fos_rest.yaml deleted file mode 100644 index 2b4189da0d..0000000000 --- a/config/packages/test_cached/fos_rest.yaml +++ /dev/null @@ -1,3 +0,0 @@ -fos_rest: - exception: - debug: true diff --git a/docs/components_and_bundles/bundles/SyliusAddressingBundle/installation.rst b/docs/components_and_bundles/bundles/SyliusAddressingBundle/installation.rst index 24e4a3f478..92ae77d8aa 100644 --- a/docs/components_and_bundles/bundles/SyliusAddressingBundle/installation.rst +++ b/docs/components_and_bundles/bundles/SyliusAddressingBundle/installation.rst @@ -42,7 +42,6 @@ Don't worry, everything was automatically installed via Composer. { $bundles = array( new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), diff --git a/docs/components_and_bundles/bundles/SyliusAttributeBundle/installation.rst b/docs/components_and_bundles/bundles/SyliusAttributeBundle/installation.rst index d13265ee9e..0fae12f59d 100644 --- a/docs/components_and_bundles/bundles/SyliusAttributeBundle/installation.rst +++ b/docs/components_and_bundles/bundles/SyliusAttributeBundle/installation.rst @@ -42,7 +42,6 @@ Don't worry, everything was automatically installed via Composer. { $bundles = array( new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), diff --git a/docs/components_and_bundles/bundles/SyliusCustomerBundle/installation.rst b/docs/components_and_bundles/bundles/SyliusCustomerBundle/installation.rst index d7203649eb..6b68c63fb2 100644 --- a/docs/components_and_bundles/bundles/SyliusCustomerBundle/installation.rst +++ b/docs/components_and_bundles/bundles/SyliusCustomerBundle/installation.rst @@ -41,7 +41,6 @@ Don't worry, everything was automatically installed via Composer. public function registerBundles() { $bundles = array( - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), diff --git a/docs/components_and_bundles/bundles/SyliusInventoryBundle/installation.rst b/docs/components_and_bundles/bundles/SyliusInventoryBundle/installation.rst index bc0d40de6e..edb73ec72f 100644 --- a/docs/components_and_bundles/bundles/SyliusInventoryBundle/installation.rst +++ b/docs/components_and_bundles/bundles/SyliusInventoryBundle/installation.rst @@ -41,7 +41,6 @@ Don't worry, everything was automatically installed via Composer. { $bundles = array( // ... - new FOS\RestBundle\FOSRestBundle(), new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(), new Sylius\Bundle\InventoryBundle\SyliusInventoryBundle(), ); diff --git a/docs/components_and_bundles/bundles/SyliusOrderBundle/installation.rst b/docs/components_and_bundles/bundles/SyliusOrderBundle/installation.rst index a52bedf742..b93013967d 100644 --- a/docs/components_and_bundles/bundles/SyliusOrderBundle/installation.rst +++ b/docs/components_and_bundles/bundles/SyliusOrderBundle/installation.rst @@ -41,7 +41,6 @@ Don't worry, everything was automatically installed via Composer. { $bundles = array( new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), diff --git a/docs/components_and_bundles/bundles/SyliusProductBundle/installation.rst b/docs/components_and_bundles/bundles/SyliusProductBundle/installation.rst index aa693c1a44..fd581524f4 100644 --- a/docs/components_and_bundles/bundles/SyliusProductBundle/installation.rst +++ b/docs/components_and_bundles/bundles/SyliusProductBundle/installation.rst @@ -41,7 +41,6 @@ Don't worry, everything was automatically installed via Composer. public function registerBundles() { $bundles = array( - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), diff --git a/docs/components_and_bundles/bundles/SyliusPromotionBundle/installation.rst b/docs/components_and_bundles/bundles/SyliusPromotionBundle/installation.rst index baa356a1db..8ccc22c655 100644 --- a/docs/components_and_bundles/bundles/SyliusPromotionBundle/installation.rst +++ b/docs/components_and_bundles/bundles/SyliusPromotionBundle/installation.rst @@ -41,7 +41,6 @@ Don't worry, everything was automatically installed via Composer. public function registerBundles() { $bundles = array( - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), diff --git a/docs/components_and_bundles/bundles/SyliusShippingBundle/installation.rst b/docs/components_and_bundles/bundles/SyliusShippingBundle/installation.rst index abf4c75b7e..128a4ee9a2 100644 --- a/docs/components_and_bundles/bundles/SyliusShippingBundle/installation.rst +++ b/docs/components_and_bundles/bundles/SyliusShippingBundle/installation.rst @@ -42,7 +42,6 @@ Don't worry, everything was automatically installed via Composer. { $bundles = array( new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), diff --git a/docs/components_and_bundles/bundles/SyliusTaxationBundle/installation.rst b/docs/components_and_bundles/bundles/SyliusTaxationBundle/installation.rst index 0cfca4abde..c701a645c4 100644 --- a/docs/components_and_bundles/bundles/SyliusTaxationBundle/installation.rst +++ b/docs/components_and_bundles/bundles/SyliusTaxationBundle/installation.rst @@ -42,7 +42,6 @@ Don't worry, everything was automatically installed via Composer. { $bundles = array( new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), diff --git a/docs/components_and_bundles/bundles/SyliusTaxonomyBundle/installation.rst b/docs/components_and_bundles/bundles/SyliusTaxonomyBundle/installation.rst index 496b9ac25e..7a1b863888 100644 --- a/docs/components_and_bundles/bundles/SyliusTaxonomyBundle/installation.rst +++ b/docs/components_and_bundles/bundles/SyliusTaxonomyBundle/installation.rst @@ -45,7 +45,6 @@ Don't worry, everything was automatically installed via Composer. { $bundles = array( new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), diff --git a/docs/components_and_bundles/bundles/SyliusUserBundle/installation.rst b/docs/components_and_bundles/bundles/SyliusUserBundle/installation.rst index e59fb9dbb3..b2127196bb 100644 --- a/docs/components_and_bundles/bundles/SyliusUserBundle/installation.rst +++ b/docs/components_and_bundles/bundles/SyliusUserBundle/installation.rst @@ -41,7 +41,6 @@ Don't worry, everything was automatically installed via Composer. public function registerBundles() { $bundles = array( - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), diff --git a/docs/cookbook/configuration/disabling-shop-admin-api.rst b/docs/cookbook/configuration/disabling-shop-admin-api.rst index ef6d5c632c..1629bc6c28 100644 --- a/docs/cookbook/configuration/disabling-shop-admin-api.rst +++ b/docs/cookbook/configuration/disabling-shop-admin-api.rst @@ -226,15 +226,6 @@ The part that has to be removed from this file is shown below: # - { path: "%sylius.security.api_regex%/.*", role: ROLE_API_ACCESS } -**5.** Remove fos_rest config from ``config/packages/fos_rest.yaml``. - -.. code-block:: yaml - - fos_rest: - format_listener: - rules: - # - { path: '^/api', priorities: ['json', 'xml'], fallback_format: json, prefer_extension: true } # remove or leave this line commented - **Done!** There is no API in Sylius now, just admin and shop. Learn more diff --git a/src/Sylius/Bundle/AddressingBundle/composer.json b/src/Sylius/Bundle/AddressingBundle/composer.json index 4291f22498..0c03f36b52 100644 --- a/src/Sylius/Bundle/AddressingBundle/composer.json +++ b/src/Sylius/Bundle/AddressingBundle/composer.json @@ -41,7 +41,6 @@ "doctrine/data-fixtures": "^1.4", "doctrine/doctrine-bundle": "^2.3.1", "doctrine/orm": "^2.13", - "friendsofsymfony/rest-bundle": "^3.0", "jms/serializer-bundle": "^5.0", "matthiasnoback/symfony-dependency-injection-test": "^5.1", "phpspec/phpspec": "^7.2", diff --git a/src/Sylius/Bundle/AddressingBundle/test/app/AppKernel.php b/src/Sylius/Bundle/AddressingBundle/test/app/AppKernel.php index 366ef171a7..a41a698613 100644 --- a/src/Sylius/Bundle/AddressingBundle/test/app/AppKernel.php +++ b/src/Sylius/Bundle/AddressingBundle/test/app/AppKernel.php @@ -21,7 +21,6 @@ class AppKernel extends Kernel return [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), diff --git a/src/Sylius/Bundle/AdminBundle/test/config/bundles.php b/src/Sylius/Bundle/AdminBundle/test/config/bundles.php index da2a206846..06f633f9ce 100644 --- a/src/Sylius/Bundle/AdminBundle/test/config/bundles.php +++ b/src/Sylius/Bundle/AdminBundle/test/config/bundles.php @@ -42,7 +42,6 @@ return [ Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true], winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class => ['all' => true], JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true], - FOS\RestBundle\FOSRestBundle::class => ['all' => true], Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true], League\FlysystemBundle\FlysystemBundle::class => ['all' => true], Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true], diff --git a/src/Sylius/Bundle/AttributeBundle/composer.json b/src/Sylius/Bundle/AttributeBundle/composer.json index da6b53fda3..6bc1e34d9e 100644 --- a/src/Sylius/Bundle/AttributeBundle/composer.json +++ b/src/Sylius/Bundle/AttributeBundle/composer.json @@ -36,7 +36,6 @@ "require-dev": { "doctrine/doctrine-bundle": "^2.3.1", "doctrine/orm": "^2.13", - "friendsofsymfony/rest-bundle": "^3.0", "jms/serializer-bundle": "^5.0", "matthiasnoback/symfony-dependency-injection-test": "^5.1", "phpspec/phpspec": "^7.2", diff --git a/src/Sylius/Bundle/AttributeBundle/test/app/AppKernel.php b/src/Sylius/Bundle/AttributeBundle/test/app/AppKernel.php index 452cad5082..fbec751063 100644 --- a/src/Sylius/Bundle/AttributeBundle/test/app/AppKernel.php +++ b/src/Sylius/Bundle/AttributeBundle/test/app/AppKernel.php @@ -21,7 +21,6 @@ class AppKernel extends Kernel return [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), diff --git a/src/Sylius/Bundle/ChannelBundle/composer.json b/src/Sylius/Bundle/ChannelBundle/composer.json index 9201a1a0e2..371aa39836 100644 --- a/src/Sylius/Bundle/ChannelBundle/composer.json +++ b/src/Sylius/Bundle/ChannelBundle/composer.json @@ -33,7 +33,6 @@ "require-dev": { "doctrine/doctrine-bundle": "^2.3.1", "doctrine/orm": "^2.13", - "friendsofsymfony/rest-bundle": "^3.0", "jms/serializer-bundle": "^5.0", "matthiasnoback/symfony-dependency-injection-test": "^5.1", "phpspec/phpspec": "^7.2", diff --git a/src/Sylius/Bundle/ChannelBundle/test/app/AppKernel.php b/src/Sylius/Bundle/ChannelBundle/test/app/AppKernel.php index 327b5aa5b0..b39015e7bc 100644 --- a/src/Sylius/Bundle/ChannelBundle/test/app/AppKernel.php +++ b/src/Sylius/Bundle/ChannelBundle/test/app/AppKernel.php @@ -21,7 +21,6 @@ class AppKernel extends Kernel return [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), diff --git a/src/Sylius/Bundle/ChannelBundle/test/app/config/config.yml b/src/Sylius/Bundle/ChannelBundle/test/app/config/config.yml index 3ee700eb77..6a6a4b0ab5 100644 --- a/src/Sylius/Bundle/ChannelBundle/test/app/config/config.yml +++ b/src/Sylius/Bundle/ChannelBundle/test/app/config/config.yml @@ -29,12 +29,3 @@ doctrine: entity_managers: default: auto_mapping: true - -fos_rest: - view: - formats: - json: true - empty_content: 204 - format_listener: - rules: - - { path: '^/', priorities: ['json'], fallback_format: json, prefer_extension: true } diff --git a/src/Sylius/Bundle/CurrencyBundle/composer.json b/src/Sylius/Bundle/CurrencyBundle/composer.json index 8f3711ab61..d19e123c66 100644 --- a/src/Sylius/Bundle/CurrencyBundle/composer.json +++ b/src/Sylius/Bundle/CurrencyBundle/composer.json @@ -38,7 +38,6 @@ "require-dev": { "doctrine/doctrine-bundle": "^2.3.1", "doctrine/orm": "^2.13", - "friendsofsymfony/rest-bundle": "^3.0", "jms/serializer-bundle": "^5.0", "matthiasnoback/symfony-dependency-injection-test": "^5.1", "phpspec/phpspec": "^7.2", diff --git a/src/Sylius/Bundle/CurrencyBundle/test/app/AppKernel.php b/src/Sylius/Bundle/CurrencyBundle/test/app/AppKernel.php index d020869d6e..473a8ad05a 100644 --- a/src/Sylius/Bundle/CurrencyBundle/test/app/AppKernel.php +++ b/src/Sylius/Bundle/CurrencyBundle/test/app/AppKernel.php @@ -21,7 +21,6 @@ class AppKernel extends Kernel return [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), diff --git a/src/Sylius/Bundle/CustomerBundle/composer.json b/src/Sylius/Bundle/CustomerBundle/composer.json index be17f2a006..7b1a0ef047 100644 --- a/src/Sylius/Bundle/CustomerBundle/composer.json +++ b/src/Sylius/Bundle/CustomerBundle/composer.json @@ -48,7 +48,6 @@ }, "require-dev": { "doctrine/doctrine-bundle": "^2.3.1", - "friendsofsymfony/rest-bundle": "^3.0", "jms/serializer-bundle": "^5.0", "phpspec/phpspec": "^7.2", "phpunit/phpunit": "^9.5", diff --git a/src/Sylius/Bundle/CustomerBundle/test/app/AppKernel.php b/src/Sylius/Bundle/CustomerBundle/test/app/AppKernel.php index 0ff4cd8698..8abdcbc104 100644 --- a/src/Sylius/Bundle/CustomerBundle/test/app/AppKernel.php +++ b/src/Sylius/Bundle/CustomerBundle/test/app/AppKernel.php @@ -21,7 +21,6 @@ class AppKernel extends Kernel return [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), diff --git a/src/Sylius/Bundle/InventoryBundle/composer.json b/src/Sylius/Bundle/InventoryBundle/composer.json index a4c5c89c88..524724297a 100644 --- a/src/Sylius/Bundle/InventoryBundle/composer.json +++ b/src/Sylius/Bundle/InventoryBundle/composer.json @@ -39,7 +39,6 @@ "require-dev": { "doctrine/doctrine-bundle": "^2.3.1", "doctrine/orm": "^2.13", - "friendsofsymfony/rest-bundle": "^3.0", "jms/serializer-bundle": "^5.0", "phpspec/phpspec": "^7.2", "phpunit/phpunit": "^9.5", diff --git a/src/Sylius/Bundle/InventoryBundle/test/app/AppKernel.php b/src/Sylius/Bundle/InventoryBundle/test/app/AppKernel.php index e10dbd55c7..e2be335a26 100644 --- a/src/Sylius/Bundle/InventoryBundle/test/app/AppKernel.php +++ b/src/Sylius/Bundle/InventoryBundle/test/app/AppKernel.php @@ -21,7 +21,6 @@ class AppKernel extends Kernel return [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(), diff --git a/src/Sylius/Bundle/LocaleBundle/composer.json b/src/Sylius/Bundle/LocaleBundle/composer.json index 308fe94dd3..e553fc2005 100644 --- a/src/Sylius/Bundle/LocaleBundle/composer.json +++ b/src/Sylius/Bundle/LocaleBundle/composer.json @@ -39,7 +39,6 @@ "doctrine/doctrine-bundle": "^2.3.1", "doctrine/orm": "^2.13", "friendsofphp/proxy-manager-lts": "^1.0.7", - "friendsofsymfony/rest-bundle": "^3.0", "jms/serializer-bundle": "^5.0", "matthiasnoback/symfony-dependency-injection-test": "^5.1", "phpspec/phpspec": "^7.2", diff --git a/src/Sylius/Bundle/LocaleBundle/test/app/AppKernel.php b/src/Sylius/Bundle/LocaleBundle/test/app/AppKernel.php index 256e9fd93a..df3464a975 100644 --- a/src/Sylius/Bundle/LocaleBundle/test/app/AppKernel.php +++ b/src/Sylius/Bundle/LocaleBundle/test/app/AppKernel.php @@ -21,7 +21,6 @@ class AppKernel extends Kernel return [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), diff --git a/src/Sylius/Bundle/MoneyBundle/composer.json b/src/Sylius/Bundle/MoneyBundle/composer.json index 25dc8ca7bb..c8b3fb1074 100644 --- a/src/Sylius/Bundle/MoneyBundle/composer.json +++ b/src/Sylius/Bundle/MoneyBundle/composer.json @@ -38,7 +38,6 @@ "require-dev": { "doctrine/doctrine-bundle": "^2.3.1", "doctrine/orm": "^2.13", - "friendsofsymfony/rest-bundle": "^3.0", "jms/serializer-bundle": "^5.0", "phpspec/phpspec": "^7.2", "phpunit/phpunit": "^9.5", diff --git a/src/Sylius/Bundle/MoneyBundle/test/app/AppKernel.php b/src/Sylius/Bundle/MoneyBundle/test/app/AppKernel.php index 6eaad18a3a..89477020f3 100644 --- a/src/Sylius/Bundle/MoneyBundle/test/app/AppKernel.php +++ b/src/Sylius/Bundle/MoneyBundle/test/app/AppKernel.php @@ -21,7 +21,6 @@ class AppKernel extends Kernel return [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), diff --git a/src/Sylius/Bundle/OrderBundle/composer.json b/src/Sylius/Bundle/OrderBundle/composer.json index bf61f5ac0f..7ade8eb53b 100644 --- a/src/Sylius/Bundle/OrderBundle/composer.json +++ b/src/Sylius/Bundle/OrderBundle/composer.json @@ -43,7 +43,6 @@ "require-dev": { "doctrine/doctrine-bundle": "^2.3.1", "doctrine/orm": "^2.13", - "friendsofsymfony/rest-bundle": "^3.0", "jms/serializer-bundle": "^5.0", "matthiasnoback/symfony-dependency-injection-test": "^5.1", "phpspec/phpspec": "^7.2", diff --git a/src/Sylius/Bundle/OrderBundle/test/app/AppKernel.php b/src/Sylius/Bundle/OrderBundle/test/app/AppKernel.php index 257e7ddfbe..417af2eec7 100644 --- a/src/Sylius/Bundle/OrderBundle/test/app/AppKernel.php +++ b/src/Sylius/Bundle/OrderBundle/test/app/AppKernel.php @@ -21,7 +21,6 @@ class AppKernel extends Kernel return [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), diff --git a/src/Sylius/Bundle/OrderBundle/test/app/config/config.yml b/src/Sylius/Bundle/OrderBundle/test/app/config/config.yml index 195e6d1715..70dc744ee5 100644 --- a/src/Sylius/Bundle/OrderBundle/test/app/config/config.yml +++ b/src/Sylius/Bundle/OrderBundle/test/app/config/config.yml @@ -29,12 +29,3 @@ doctrine: entity_managers: default: auto_mapping: true - -fos_rest: - view: - formats: - json: true - empty_content: 204 - format_listener: - rules: - - { path: '^/', priorities: ['json'], fallback_format: json, prefer_extension: true } diff --git a/src/Sylius/Bundle/PaymentBundle/composer.json b/src/Sylius/Bundle/PaymentBundle/composer.json index f7d5272f99..d09ab5c0b1 100644 --- a/src/Sylius/Bundle/PaymentBundle/composer.json +++ b/src/Sylius/Bundle/PaymentBundle/composer.json @@ -37,7 +37,6 @@ "require-dev": { "doctrine/doctrine-bundle": "^2.3.1", "doctrine/orm": "^2.13", - "friendsofsymfony/rest-bundle": "^3.0", "jms/serializer-bundle": "^5.0", "matthiasnoback/symfony-dependency-injection-test": "^5.1", "phpspec/phpspec": "^7.2", diff --git a/src/Sylius/Bundle/PaymentBundle/test/app/AppKernel.php b/src/Sylius/Bundle/PaymentBundle/test/app/AppKernel.php index 557c5e96d8..67ca3597de 100644 --- a/src/Sylius/Bundle/PaymentBundle/test/app/AppKernel.php +++ b/src/Sylius/Bundle/PaymentBundle/test/app/AppKernel.php @@ -21,7 +21,6 @@ class AppKernel extends Kernel return [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), diff --git a/src/Sylius/Bundle/ProductBundle/composer.json b/src/Sylius/Bundle/ProductBundle/composer.json index 0e1ccb210b..9e1f9353e2 100644 --- a/src/Sylius/Bundle/ProductBundle/composer.json +++ b/src/Sylius/Bundle/ProductBundle/composer.json @@ -37,7 +37,6 @@ "require-dev": { "doctrine/doctrine-bundle": "^2.3.1", "doctrine/orm": "^2.13", - "friendsofsymfony/rest-bundle": "^3.0", "jms/serializer-bundle": "^5.0", "matthiasnoback/symfony-dependency-injection-test": "^5.1", "mockery/mockery": "^1.4", diff --git a/src/Sylius/Bundle/ProductBundle/test/app/AppKernel.php b/src/Sylius/Bundle/ProductBundle/test/app/AppKernel.php index 3d297eeed1..84848cda5e 100644 --- a/src/Sylius/Bundle/ProductBundle/test/app/AppKernel.php +++ b/src/Sylius/Bundle/ProductBundle/test/app/AppKernel.php @@ -21,7 +21,6 @@ class AppKernel extends Kernel return [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), diff --git a/src/Sylius/Bundle/PromotionBundle/composer.json b/src/Sylius/Bundle/PromotionBundle/composer.json index 270317cbba..6e847c92da 100644 --- a/src/Sylius/Bundle/PromotionBundle/composer.json +++ b/src/Sylius/Bundle/PromotionBundle/composer.json @@ -43,7 +43,6 @@ "require-dev": { "doctrine/doctrine-bundle": "^2.3.1", "doctrine/orm": "^2.13", - "friendsofsymfony/rest-bundle": "^3.0", "jms/serializer-bundle": "^5.0", "matthiasnoback/symfony-dependency-injection-test": "^5.1", "phpspec/phpspec": "^7.2", diff --git a/src/Sylius/Bundle/PromotionBundle/test/app/AppKernel.php b/src/Sylius/Bundle/PromotionBundle/test/app/AppKernel.php index 7b4acdf00e..57aa3a447c 100644 --- a/src/Sylius/Bundle/PromotionBundle/test/app/AppKernel.php +++ b/src/Sylius/Bundle/PromotionBundle/test/app/AppKernel.php @@ -21,7 +21,6 @@ class AppKernel extends Kernel return [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), diff --git a/src/Sylius/Bundle/ReviewBundle/composer.json b/src/Sylius/Bundle/ReviewBundle/composer.json index 7a1955a9ea..e631af12a6 100644 --- a/src/Sylius/Bundle/ReviewBundle/composer.json +++ b/src/Sylius/Bundle/ReviewBundle/composer.json @@ -51,7 +51,6 @@ }, "require-dev": { "doctrine/doctrine-bundle": "^2.3.1", - "friendsofsymfony/rest-bundle": "^3.0", "jms/serializer-bundle": "^5.0", "phpspec/phpspec": "^7.2", "phpspec/prophecy-phpunit": "^2.0", diff --git a/src/Sylius/Bundle/ReviewBundle/test/app/AppKernel.php b/src/Sylius/Bundle/ReviewBundle/test/app/AppKernel.php index 36d9a08b0e..d2821678a4 100644 --- a/src/Sylius/Bundle/ReviewBundle/test/app/AppKernel.php +++ b/src/Sylius/Bundle/ReviewBundle/test/app/AppKernel.php @@ -22,7 +22,6 @@ class AppKernel extends Kernel new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(), new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), diff --git a/src/Sylius/Bundle/ReviewBundle/test/app/config/config.yml b/src/Sylius/Bundle/ReviewBundle/test/app/config/config.yml index eacae10e92..5618f909d9 100644 --- a/src/Sylius/Bundle/ReviewBundle/test/app/config/config.yml +++ b/src/Sylius/Bundle/ReviewBundle/test/app/config/config.yml @@ -30,15 +30,6 @@ doctrine: default: auto_mapping: true -fos_rest: - view: - formats: - json: true - empty_content: 204 - format_listener: - rules: - - { path: '^/', priorities: ['json'], fallback_format: json, prefer_extension: true } - security: providers: sylius_admin_user_provider: diff --git a/src/Sylius/Bundle/ShippingBundle/composer.json b/src/Sylius/Bundle/ShippingBundle/composer.json index c80e99c789..146cb30a7c 100644 --- a/src/Sylius/Bundle/ShippingBundle/composer.json +++ b/src/Sylius/Bundle/ShippingBundle/composer.json @@ -43,7 +43,6 @@ "require-dev": { "doctrine/doctrine-bundle": "^2.3.1", "doctrine/orm": "^2.13", - "friendsofsymfony/rest-bundle": "^3.0", "jms/serializer-bundle": "^5.0", "matthiasnoback/symfony-dependency-injection-test": "^5.1", "phpspec/phpspec": "^7.2", diff --git a/src/Sylius/Bundle/ShippingBundle/test/app/AppKernel.php b/src/Sylius/Bundle/ShippingBundle/test/app/AppKernel.php index a7651e29d6..d2c33991da 100644 --- a/src/Sylius/Bundle/ShippingBundle/test/app/AppKernel.php +++ b/src/Sylius/Bundle/ShippingBundle/test/app/AppKernel.php @@ -21,7 +21,6 @@ class AppKernel extends Kernel return [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), diff --git a/src/Sylius/Bundle/ShippingBundle/test/app/config/config.yml b/src/Sylius/Bundle/ShippingBundle/test/app/config/config.yml index 24082fa18b..4253bb0109 100644 --- a/src/Sylius/Bundle/ShippingBundle/test/app/config/config.yml +++ b/src/Sylius/Bundle/ShippingBundle/test/app/config/config.yml @@ -29,12 +29,3 @@ doctrine: entity_managers: default: auto_mapping: true - -fos_rest: - view: - formats: - json: true - empty_content: 204 - format_listener: - rules: - - { path: '^/', priorities: ['json'], fallback_format: json, prefer_extension: true } diff --git a/src/Sylius/Bundle/TaxationBundle/composer.json b/src/Sylius/Bundle/TaxationBundle/composer.json index d43d61830b..a00738ba0e 100644 --- a/src/Sylius/Bundle/TaxationBundle/composer.json +++ b/src/Sylius/Bundle/TaxationBundle/composer.json @@ -42,7 +42,6 @@ "require-dev": { "doctrine/doctrine-bundle": "^2.3.1", "doctrine/orm": "^2.13", - "friendsofsymfony/rest-bundle": "^3.0", "jms/serializer-bundle": "^5.0", "matthiasnoback/symfony-dependency-injection-test": "^5.1", "phpspec/phpspec": "^7.2", diff --git a/src/Sylius/Bundle/TaxationBundle/test/app/AppKernel.php b/src/Sylius/Bundle/TaxationBundle/test/app/AppKernel.php index 4bbce4c830..d70bf457b3 100644 --- a/src/Sylius/Bundle/TaxationBundle/test/app/AppKernel.php +++ b/src/Sylius/Bundle/TaxationBundle/test/app/AppKernel.php @@ -21,7 +21,6 @@ class AppKernel extends Kernel return [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), diff --git a/src/Sylius/Bundle/TaxonomyBundle/Tests/Functional/app/AppKernel.php b/src/Sylius/Bundle/TaxonomyBundle/Tests/Functional/app/AppKernel.php index 4a5ff4fb26..fb46f4139e 100644 --- a/src/Sylius/Bundle/TaxonomyBundle/Tests/Functional/app/AppKernel.php +++ b/src/Sylius/Bundle/TaxonomyBundle/Tests/Functional/app/AppKernel.php @@ -21,7 +21,6 @@ class AppKernel extends Kernel return [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), diff --git a/src/Sylius/Bundle/TaxonomyBundle/composer.json b/src/Sylius/Bundle/TaxonomyBundle/composer.json index 9bbd4f0df7..c8ca26e3e2 100644 --- a/src/Sylius/Bundle/TaxonomyBundle/composer.json +++ b/src/Sylius/Bundle/TaxonomyBundle/composer.json @@ -41,7 +41,6 @@ "require-dev": { "doctrine/doctrine-bundle": "^2.3.1", "doctrine/orm": "^2.13", - "friendsofsymfony/rest-bundle": "^3.0", "jms/serializer-bundle": "^5.0", "phpspec/phpspec": "^7.2", "phpunit/phpunit": "^9.5", diff --git a/src/Sylius/Bundle/UserBundle/Tests/Functional/app/AppKernel.php b/src/Sylius/Bundle/UserBundle/Tests/Functional/app/AppKernel.php index f2de4b8e9e..fdfb8413d7 100644 --- a/src/Sylius/Bundle/UserBundle/Tests/Functional/app/AppKernel.php +++ b/src/Sylius/Bundle/UserBundle/Tests/Functional/app/AppKernel.php @@ -22,7 +22,6 @@ class AppKernel extends Kernel new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(), new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), - new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), diff --git a/src/Sylius/Bundle/UserBundle/composer.json b/src/Sylius/Bundle/UserBundle/composer.json index 6e60a0d097..1ce9bd43dc 100644 --- a/src/Sylius/Bundle/UserBundle/composer.json +++ b/src/Sylius/Bundle/UserBundle/composer.json @@ -52,7 +52,6 @@ }, "require-dev": { "doctrine/doctrine-bundle": "^2.3.1", - "friendsofsymfony/rest-bundle": "^3.0", "hwi/oauth-bundle": "^1.1 || ^2.0@beta", "jms/serializer-bundle": "^5.0", "matthiasnoback/symfony-dependency-injection-test": "^5.1", diff --git a/src/Sylius/Component/Addressing/composer.json b/src/Sylius/Component/Addressing/composer.json index a5c41a310a..6f9b6e2a67 100644 --- a/src/Sylius/Component/Addressing/composer.json +++ b/src/Sylius/Component/Addressing/composer.json @@ -28,7 +28,7 @@ "require": { "php": "^8.2", "sylius/registry": "^1.6", - "sylius/resource": "^1.11 || ^1.12@alpha", + "sylius/resource": "^1.12@alpha", "symfony/intl": "^6.4.0 || ^7.1" }, "require-dev": { diff --git a/src/Sylius/Component/Attribute/composer.json b/src/Sylius/Component/Attribute/composer.json index 866e29fb72..80d664e36c 100644 --- a/src/Sylius/Component/Attribute/composer.json +++ b/src/Sylius/Component/Attribute/composer.json @@ -28,7 +28,7 @@ "php": "^8.2", "doctrine/collections": "^1.6", "sylius/registry": "^1.6", - "sylius/resource": "^1.11 || ^1.12@alpha", + "sylius/resource": "^1.12@alpha", "symfony/validator": "^6.4.0 || ^7.1" }, "require-dev": { diff --git a/src/Sylius/Component/Channel/composer.json b/src/Sylius/Component/Channel/composer.json index 0807e0013f..e22133fedc 100644 --- a/src/Sylius/Component/Channel/composer.json +++ b/src/Sylius/Component/Channel/composer.json @@ -28,7 +28,7 @@ ], "require": { "php": "^8.2", - "sylius/resource": "^1.11 || ^1.12@alpha", + "sylius/resource": "^1.12@alpha", "symfony/form": "^6.4.1 || ^7.1", "symfony/http-foundation": "^6.4.0 || ^7.1", "laminas/laminas-stdlib": "^3.3.1" diff --git a/src/Sylius/Component/Core/composer.json b/src/Sylius/Component/Core/composer.json index 6bafcb0d28..424d2692f0 100644 --- a/src/Sylius/Component/Core/composer.json +++ b/src/Sylius/Component/Core/composer.json @@ -46,7 +46,7 @@ "sylius/product": "^2.0", "sylius/promotion": "^2.0", "sylius/registry": "^1.6", - "sylius/resource": "^1.11 || ^1.12@alpha", + "sylius/resource": "^1.12@alpha", "sylius/review": "^2.0", "sylius/shipping": "^2.0", "sylius/state-machine-abstraction": "^2.0", diff --git a/src/Sylius/Component/Currency/composer.json b/src/Sylius/Component/Currency/composer.json index 793ff7870b..24801bc891 100644 --- a/src/Sylius/Component/Currency/composer.json +++ b/src/Sylius/Component/Currency/composer.json @@ -26,7 +26,7 @@ ], "require": { "php": "^8.2", - "sylius/resource": "^1.11 || ^1.12@alpha", + "sylius/resource": "^1.12@alpha", "symfony/intl": "^6.4.0 || ^7.1", "laminas/laminas-stdlib": "^3.3.1" }, diff --git a/src/Sylius/Component/Customer/composer.json b/src/Sylius/Component/Customer/composer.json index 16717a8149..27efe0f9c6 100644 --- a/src/Sylius/Component/Customer/composer.json +++ b/src/Sylius/Component/Customer/composer.json @@ -33,7 +33,7 @@ "require": { "php": "^8.2", "doctrine/collections": "^1.6", - "sylius/resource": "^1.11 || ^1.12@alpha" + "sylius/resource": "^1.12@alpha" }, "require-dev": { "phpspec/phpspec": "^7.2" diff --git a/src/Sylius/Component/Inventory/composer.json b/src/Sylius/Component/Inventory/composer.json index 129fe0d52a..a6790ebb2a 100644 --- a/src/Sylius/Component/Inventory/composer.json +++ b/src/Sylius/Component/Inventory/composer.json @@ -27,7 +27,7 @@ ], "require": { "php": "^8.2", - "sylius/resource": "^1.11 || ^1.12@alpha", + "sylius/resource": "^1.12@alpha", "webmozart/assert": "^1.9" }, "require-dev": { diff --git a/src/Sylius/Component/Locale/composer.json b/src/Sylius/Component/Locale/composer.json index fa5f533c56..e34a2fd7e3 100644 --- a/src/Sylius/Component/Locale/composer.json +++ b/src/Sylius/Component/Locale/composer.json @@ -27,7 +27,7 @@ ], "require": { "php": "^8.2", - "sylius/resource": "^1.11 || ^1.12@alpha", + "sylius/resource": "^1.12@alpha", "symfony/intl": "^6.4.0 || ^7.1", "laminas/laminas-stdlib": "^3.3.1" }, diff --git a/src/Sylius/Component/Order/composer.json b/src/Sylius/Component/Order/composer.json index 29c11a7dd0..ab6351c39e 100644 --- a/src/Sylius/Component/Order/composer.json +++ b/src/Sylius/Component/Order/composer.json @@ -27,7 +27,7 @@ ], "require": { "php": "^8.2", - "sylius/resource": "^1.11 || ^1.12@alpha", + "sylius/resource": "^1.12@alpha", "webmozart/assert": "^1.9", "laminas/laminas-stdlib": "^3.3.1" }, diff --git a/src/Sylius/Component/Payment/composer.json b/src/Sylius/Component/Payment/composer.json index b65cd5b482..877600569b 100644 --- a/src/Sylius/Component/Payment/composer.json +++ b/src/Sylius/Component/Payment/composer.json @@ -28,7 +28,7 @@ "require": { "php": "^8.2", "sylius/registry": "^1.6", - "sylius/resource": "^1.11 || ^1.12@alpha" + "sylius/resource": "^1.12@alpha" }, "require-dev": { "phpspec/phpspec": "^7.2" diff --git a/src/Sylius/Component/Product/composer.json b/src/Sylius/Component/Product/composer.json index 2020241293..771787d1d9 100644 --- a/src/Sylius/Component/Product/composer.json +++ b/src/Sylius/Component/Product/composer.json @@ -31,7 +31,7 @@ "php": "^8.2", "behat/transliterator": "^1.3", "sylius/attribute": "^2.0", - "sylius/resource": "^1.11 || ^1.12@alpha", + "sylius/resource": "^1.12@alpha", "symfony/polyfill-iconv": "^1.28", "webmozart/assert": "^1.9" }, diff --git a/src/Sylius/Component/Promotion/composer.json b/src/Sylius/Component/Promotion/composer.json index 87bcbdff6b..2e12157c34 100644 --- a/src/Sylius/Component/Promotion/composer.json +++ b/src/Sylius/Component/Promotion/composer.json @@ -28,7 +28,7 @@ "php": "^8.2", "doctrine/orm": "^2.13", "sylius/registry": "^1.6", - "sylius/resource": "^1.11 || ^1.12@alpha" + "sylius/resource": "^1.12@alpha" }, "require-dev": { "phpspec/phpspec": "^7.2" diff --git a/src/Sylius/Component/Review/composer.json b/src/Sylius/Component/Review/composer.json index 6bc1ebfe26..4e9db2398e 100644 --- a/src/Sylius/Component/Review/composer.json +++ b/src/Sylius/Component/Review/composer.json @@ -39,7 +39,7 @@ "require": { "php": "^8.2", "doctrine/collections": "^1.6", - "sylius/resource": "^1.11 || ^1.12@alpha" + "sylius/resource": "^1.12@alpha" }, "require-dev": { "phpspec/phpspec": "^7.2" diff --git a/src/Sylius/Component/Shipping/composer.json b/src/Sylius/Component/Shipping/composer.json index 16b2b0713b..5c2cf4d9c5 100644 --- a/src/Sylius/Component/Shipping/composer.json +++ b/src/Sylius/Component/Shipping/composer.json @@ -30,7 +30,7 @@ "require": { "php": "^8.2", "sylius/registry": "^1.6", - "sylius/resource": "^1.11 || ^1.12@alpha", + "sylius/resource": "^1.12@alpha", "symfony/options-resolver": "^6.4.0 || ^7.1" }, "require-dev": { diff --git a/src/Sylius/Component/Taxation/composer.json b/src/Sylius/Component/Taxation/composer.json index 504f5bc740..2de234403f 100644 --- a/src/Sylius/Component/Taxation/composer.json +++ b/src/Sylius/Component/Taxation/composer.json @@ -30,7 +30,7 @@ "require": { "php": "^8.2", "sylius/registry": "^1.6", - "sylius/resource": "^1.11 || ^1.12@alpha", + "sylius/resource": "^1.12@alpha", "symfony/clock": "^6.4.0 || ^7.1" }, "require-dev": { diff --git a/src/Sylius/Component/Taxonomy/composer.json b/src/Sylius/Component/Taxonomy/composer.json index 65a0d07bb2..c0625ff876 100644 --- a/src/Sylius/Component/Taxonomy/composer.json +++ b/src/Sylius/Component/Taxonomy/composer.json @@ -28,7 +28,7 @@ "require": { "php": "^8.2", "behat/transliterator": "^1.3", - "sylius/resource": "^1.11 || ^1.12@alpha", + "sylius/resource": "^1.12@alpha", "webmozart/assert": "^1.9" }, "require-dev": { diff --git a/src/Sylius/Component/User/composer.json b/src/Sylius/Component/User/composer.json index 440d437445..0420879511 100644 --- a/src/Sylius/Component/User/composer.json +++ b/src/Sylius/Component/User/composer.json @@ -36,7 +36,7 @@ "php": "^8.2", "doctrine/collections": "^1.6", "phpunit/phpunit": "^9.5", - "sylius/resource": "^1.11 || ^1.12@alpha", + "sylius/resource": "^1.12@alpha", "symfony/polyfill-mbstring": "^1.28", "symfony/security-core": "^6.4.0 || ^7.1" }, diff --git a/symfony.lock b/symfony.lock index 0e292864e5..eded6a8372 100644 --- a/symfony.lock +++ b/symfony.lock @@ -173,15 +173,6 @@ "friendsofphp/proxy-manager-lts": { "version": "v1.0.2" }, - "friendsofsymfony/rest-bundle": { - "version": "2.2", - "recipe": { - "repo": "github.com/symfony/recipes-contrib", - "branch": "master", - "version": "2.2", - "ref": "cad41ef93d6150067ae2bb3c7fd729492dff6f0a" - } - }, "gedmo/doctrine-extensions": { "version": "v2.4.42" }, @@ -985,9 +976,6 @@ "webmozart/assert": { "version": "1.9.1" }, - "willdurand/jsonp-callback-validator": { - "version": "v1.1.0" - }, "willdurand/negotiation": { "version": "v2.3.1" }, From 2ff455c82ede1572f32929fd04b71905f6de5bc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pysiak?= Date: Fri, 27 Sep 2024 06:10:22 +0200 Subject: [PATCH 2/6] Remove FlattenExcepitonNormalizer --- ...ceptionNormalizerDecoratorCompilerPass.php | 28 ------- .../LegacyErrorHandlingCompilerPass.php | 5 -- .../Resources/config/services/serializers.xml | 6 -- .../Serializer/FlattenExceptionNormalizer.php | 51 ------------ .../Bundle/ApiBundle/SyliusApiBundle.php | 2 - ...ionNormalizerDecoratorCompilerPassTest.php | 49 ------------ .../LegacyErrorHandlingCompilerPassTest.php | 5 -- .../FlattenExceptionNormalizerSpec.php | 78 ------------------- 8 files changed, 224 deletions(-) delete mode 100644 src/Sylius/Bundle/ApiBundle/DependencyInjection/Compiler/FlattenExceptionNormalizerDecoratorCompilerPass.php delete mode 100644 src/Sylius/Bundle/ApiBundle/Serializer/FlattenExceptionNormalizer.php delete mode 100644 src/Sylius/Bundle/ApiBundle/Tests/DependencyInjection/Compiler/FlattenExceptionNormalizerDecoratorCompilerPassTest.php delete mode 100644 src/Sylius/Bundle/ApiBundle/spec/Serializer/FlattenExceptionNormalizerSpec.php diff --git a/src/Sylius/Bundle/ApiBundle/DependencyInjection/Compiler/FlattenExceptionNormalizerDecoratorCompilerPass.php b/src/Sylius/Bundle/ApiBundle/DependencyInjection/Compiler/FlattenExceptionNormalizerDecoratorCompilerPass.php deleted file mode 100644 index eb5f0d4a34..0000000000 --- a/src/Sylius/Bundle/ApiBundle/DependencyInjection/Compiler/FlattenExceptionNormalizerDecoratorCompilerPass.php +++ /dev/null @@ -1,28 +0,0 @@ -hasDefinition('fos_rest.serializer.flatten_exception_normalizer')) { - $container->removeDefinition(FlattenExceptionNormalizer::class); - } - } -} diff --git a/src/Sylius/Bundle/ApiBundle/DependencyInjection/Compiler/LegacyErrorHandlingCompilerPass.php b/src/Sylius/Bundle/ApiBundle/DependencyInjection/Compiler/LegacyErrorHandlingCompilerPass.php index da9ee6937d..35838271e1 100644 --- a/src/Sylius/Bundle/ApiBundle/DependencyInjection/Compiler/LegacyErrorHandlingCompilerPass.php +++ b/src/Sylius/Bundle/ApiBundle/DependencyInjection/Compiler/LegacyErrorHandlingCompilerPass.php @@ -13,7 +13,6 @@ declare(strict_types=1); namespace Sylius\Bundle\ApiBundle\DependencyInjection\Compiler; -use Sylius\Bundle\ApiBundle\Serializer\FlattenExceptionNormalizer; use Sylius\Bundle\ApiBundle\Serializer\HydraErrorNormalizer; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -35,9 +34,5 @@ final readonly class LegacyErrorHandlingCompilerPass implements CompilerPassInte if ($container->hasDefinition(HydraErrorNormalizer::class)) { $container->removeDefinition(HydraErrorNormalizer::class); } - - if ($container->hasDefinition(FlattenExceptionNormalizer::class)) { - $container->removeDefinition(FlattenExceptionNormalizer::class); - } } } diff --git a/src/Sylius/Bundle/ApiBundle/Resources/config/services/serializers.xml b/src/Sylius/Bundle/ApiBundle/Resources/config/services/serializers.xml index 91cf31953d..5147c651f8 100644 --- a/src/Sylius/Bundle/ApiBundle/Resources/config/services/serializers.xml +++ b/src/Sylius/Bundle/ApiBundle/Resources/config/services/serializers.xml @@ -90,12 +90,6 @@ - - - - %sylius.security.new_api_route% - - diff --git a/src/Sylius/Bundle/ApiBundle/Serializer/FlattenExceptionNormalizer.php b/src/Sylius/Bundle/ApiBundle/Serializer/FlattenExceptionNormalizer.php deleted file mode 100644 index b176077147..0000000000 --- a/src/Sylius/Bundle/ApiBundle/Serializer/FlattenExceptionNormalizer.php +++ /dev/null @@ -1,51 +0,0 @@ -requestStack->getMainRequest(); - if (null === $request) { - return false; - } - - if (str_starts_with($request->getPathInfo(), $this->newApiRoute)) { - return false; - } - - return $this->decorated->supportsNormalization($data, $format, $context); - } - - public function normalize(mixed $object, ?string $format = null, array $context = []): array - { - return $this->decorated->normalize($object, $format, $context); - } - - public function getSupportedTypes(?string $format): array - { - return ['object' => true]; - } -} diff --git a/src/Sylius/Bundle/ApiBundle/SyliusApiBundle.php b/src/Sylius/Bundle/ApiBundle/SyliusApiBundle.php index 67d7f56b31..68dbf1182a 100644 --- a/src/Sylius/Bundle/ApiBundle/SyliusApiBundle.php +++ b/src/Sylius/Bundle/ApiBundle/SyliusApiBundle.php @@ -13,7 +13,6 @@ declare(strict_types=1); namespace Sylius\Bundle\ApiBundle; -use Sylius\Bundle\ApiBundle\DependencyInjection\Compiler\FlattenExceptionNormalizerDecoratorCompilerPass; use Sylius\Bundle\ApiBundle\DependencyInjection\Compiler\LegacyErrorHandlingCompilerPass; use Sylius\Bundle\ApiBundle\DependencyInjection\Compiler\XmlResourceExtractorCompilerPass; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -23,7 +22,6 @@ final class SyliusApiBundle extends Bundle { public function build(ContainerBuilder $container): void { - $container->addCompilerPass(new FlattenExceptionNormalizerDecoratorCompilerPass()); $container->addCompilerPass(new LegacyErrorHandlingCompilerPass()); $container->addCompilerPass(new XmlResourceExtractorCompilerPass()); } diff --git a/src/Sylius/Bundle/ApiBundle/Tests/DependencyInjection/Compiler/FlattenExceptionNormalizerDecoratorCompilerPassTest.php b/src/Sylius/Bundle/ApiBundle/Tests/DependencyInjection/Compiler/FlattenExceptionNormalizerDecoratorCompilerPassTest.php deleted file mode 100644 index cedfe7d581..0000000000 --- a/src/Sylius/Bundle/ApiBundle/Tests/DependencyInjection/Compiler/FlattenExceptionNormalizerDecoratorCompilerPassTest.php +++ /dev/null @@ -1,49 +0,0 @@ -setDefinition(FlattenExceptionNormalizer::class, new Definition()); - $this->setDefinition('fos_rest.serializer.flatten_exception_normalizer', new Definition()); - - $this->compile(); - - $this->assertContainerBuilderHasService(FlattenExceptionNormalizer::class); - } - - /** @test */ - public function it_removes_decoration_when_decorated_service_doesnt_exist(): void - { - $this->setDefinition(FlattenExceptionNormalizer::class, new Definition()); - - $this->compile(); - - $this->assertContainerBuilderNotHasService(FlattenExceptionNormalizer::class); - } - - protected function registerCompilerPass(ContainerBuilder $container): void - { - $container->addCompilerPass(new FlattenExceptionNormalizerDecoratorCompilerPass()); - } -} diff --git a/src/Sylius/Bundle/ApiBundle/Tests/DependencyInjection/Compiler/LegacyErrorHandlingCompilerPassTest.php b/src/Sylius/Bundle/ApiBundle/Tests/DependencyInjection/Compiler/LegacyErrorHandlingCompilerPassTest.php index 20475916ca..13016a7248 100644 --- a/src/Sylius/Bundle/ApiBundle/Tests/DependencyInjection/Compiler/LegacyErrorHandlingCompilerPassTest.php +++ b/src/Sylius/Bundle/ApiBundle/Tests/DependencyInjection/Compiler/LegacyErrorHandlingCompilerPassTest.php @@ -15,7 +15,6 @@ namespace Sylius\Bundle\ApiBundle\Tests\DependencyInjection\Compiler; use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractCompilerPassTestCase; use Sylius\Bundle\ApiBundle\DependencyInjection\Compiler\LegacyErrorHandlingCompilerPass; -use Sylius\Bundle\ApiBundle\Serializer\FlattenExceptionNormalizer; use Sylius\Bundle\ApiBundle\Serializer\HydraErrorNormalizer; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; @@ -27,12 +26,10 @@ final class LegacyErrorHandlingCompilerPassTest extends AbstractCompilerPassTest { $this->setParameter('sylius_api.legacy_error_handling', false); $this->setDefinition(HydraErrorNormalizer::class, new Definition()); - $this->setDefinition(FlattenExceptionNormalizer::class, new Definition()); $this->compile(); $this->assertContainerBuilderHasService(HydraErrorNormalizer::class); - $this->assertContainerBuilderHasService(FlattenExceptionNormalizer::class); } /** @test */ @@ -40,12 +37,10 @@ final class LegacyErrorHandlingCompilerPassTest extends AbstractCompilerPassTest { $this->setParameter('sylius_api.legacy_error_handling', true); $this->setDefinition(HydraErrorNormalizer::class, new Definition()); - $this->setDefinition(FlattenExceptionNormalizer::class, new Definition()); $this->compile(); $this->assertContainerBuilderNotHasService(HydraErrorNormalizer::class); - $this->assertContainerBuilderNotHasService(FlattenExceptionNormalizer::class); } protected function registerCompilerPass(ContainerBuilder $container): void diff --git a/src/Sylius/Bundle/ApiBundle/spec/Serializer/FlattenExceptionNormalizerSpec.php b/src/Sylius/Bundle/ApiBundle/spec/Serializer/FlattenExceptionNormalizerSpec.php deleted file mode 100644 index bc6d85f266..0000000000 --- a/src/Sylius/Bundle/ApiBundle/spec/Serializer/FlattenExceptionNormalizerSpec.php +++ /dev/null @@ -1,78 +0,0 @@ -beConstructedWith($normalizer, $requestStack, '/api/v1'); - - $normalizer->normalize('data', 'format', ['context'])->willReturn([])->shouldBeCalled(); - - $this->normalize('data', 'format', ['context']); - } - - function it_doesnt_support_normalization_when_path_starts_with_new_api_route( - NormalizerInterface $normalizer, - RequestStack $requestStack, - Request $request, - ): void { - $this->beConstructedWith($normalizer, $requestStack, '/api/v2'); - - $request->getPathInfo()->willReturn('/api/v2/products'); - - $requestStack->getMainRequest()->willReturn($request); - - $normalizer->supportsNormalization('data', 'format', ['context'])->shouldNotBeCalled(); - - $this->supportsNormalization('data', 'format', ['context']); - } - - function it_supports_normalization_when_path_doesnt_start_with_new_api_route( - NormalizerInterface $normalizer, - RequestStack $requestStack, - Request $request, - ): void { - $this->beConstructedWith($normalizer, $requestStack, '/api/v2'); - - $request->getPathInfo()->willReturn('/api/v1/products'); - - $requestStack->getMainRequest()->willReturn($request); - - $normalizer->supportsNormalization('data', 'format', ['context'])->shouldBeCalled()->willReturn(true); - - $this->supportsNormalization('data', 'format', ['context'])->shouldReturn(true); - } - - function it_doesnt_support_normalization_when_no_request_is_available( - NormalizerInterface $normalizer, - RequestStack $requestStack, - ): void { - $this->beConstructedWith($normalizer, $requestStack, '/api/v2'); - - $requestStack->getMainRequest()->willReturn(null); - - $normalizer->supportsNormalization('data', 'format', ['context'])->shouldNotBeCalled(); - - $this->supportsNormalization('data', 'format', ['context']); - } -} From e45919de756fdaeedeba44a0232e97492b6d03d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pysiak?= Date: Fri, 27 Sep 2024 06:10:51 +0200 Subject: [PATCH 3/6] remove configs --- .../Bundle/TaxationBundle/test/app/config/config.yml | 9 --------- .../UserBundle/Tests/Functional/app/config/config.yml | 9 --------- 2 files changed, 18 deletions(-) diff --git a/src/Sylius/Bundle/TaxationBundle/test/app/config/config.yml b/src/Sylius/Bundle/TaxationBundle/test/app/config/config.yml index a772377f69..fc332ed6f0 100644 --- a/src/Sylius/Bundle/TaxationBundle/test/app/config/config.yml +++ b/src/Sylius/Bundle/TaxationBundle/test/app/config/config.yml @@ -29,12 +29,3 @@ doctrine: entity_managers: default: auto_mapping: true - -fos_rest: - view: - formats: - json: true - empty_content: 204 - format_listener: - rules: - - { path: '^/', priorities: ['json'], fallback_format: json, prefer_extension: true } diff --git a/src/Sylius/Bundle/UserBundle/Tests/Functional/app/config/config.yml b/src/Sylius/Bundle/UserBundle/Tests/Functional/app/config/config.yml index a39fa7b72f..e45abac210 100644 --- a/src/Sylius/Bundle/UserBundle/Tests/Functional/app/config/config.yml +++ b/src/Sylius/Bundle/UserBundle/Tests/Functional/app/config/config.yml @@ -34,15 +34,6 @@ doctrine: default: auto_mapping: true -fos_rest: - view: - formats: - json: true - empty_content: 204 - format_listener: - rules: - - { path: '^/', priorities: ['json'], fallback_format: json, prefer_extension: true } - security: providers: sylius_admin_user_provider: From 432411c84b646b2c5046974c91036271571ad142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pysiak?= Date: Fri, 27 Sep 2024 06:22:21 +0200 Subject: [PATCH 4/6] refactor controllers --- .../CoreBundle/Controller/OrderController.php | 3 +-- .../Controller/OrderController.php | 9 +++---- .../Controller/PromotionCouponController.php | 3 +-- .../UserBundle/Controller/UserController.php | 27 +++++++++---------- 4 files changed, 19 insertions(+), 23 deletions(-) diff --git a/src/Sylius/Bundle/CoreBundle/Controller/OrderController.php b/src/Sylius/Bundle/CoreBundle/Controller/OrderController.php index eaf51d9dd9..69f81954ad 100644 --- a/src/Sylius/Bundle/CoreBundle/Controller/OrderController.php +++ b/src/Sylius/Bundle/CoreBundle/Controller/OrderController.php @@ -13,7 +13,6 @@ declare(strict_types=1); namespace Sylius\Bundle\CoreBundle\Controller; -use FOS\RestBundle\View\View; use Sylius\Bundle\OrderBundle\Controller\OrderController as BaseOrderController; use Sylius\Component\Core\Repository\OrderRepositoryInterface; use Sylius\Component\Order\SyliusCartEvents; @@ -46,7 +45,7 @@ class OrderController extends BaseOrderController } if (!$configuration->isHtmlRequest()) { - return $this->viewHandler->handle($configuration, View::create($cart)); + return $this->createRestView($configuration, $cart); } $form = $this->resourceFormFactory->create($configuration, $cart); diff --git a/src/Sylius/Bundle/OrderBundle/Controller/OrderController.php b/src/Sylius/Bundle/OrderBundle/Controller/OrderController.php index 9fa118ce57..2ce76f2a02 100644 --- a/src/Sylius/Bundle/OrderBundle/Controller/OrderController.php +++ b/src/Sylius/Bundle/OrderBundle/Controller/OrderController.php @@ -13,7 +13,6 @@ declare(strict_types=1); namespace Sylius\Bundle\OrderBundle\Controller; -use FOS\RestBundle\View\View; use Sylius\Bundle\ResourceBundle\Controller\ResourceController; use Sylius\Component\Order\Context\CartContextInterface; use Sylius\Component\Order\Model\OrderInterface; @@ -47,7 +46,7 @@ class OrderController extends ResourceController } if (!$configuration->isHtmlRequest()) { - return $this->viewHandler->handle($configuration, View::create($cart)); + return $this->createRestView($configuration, $cart); } $form = $this->resourceFormFactory->create($configuration, $cart); @@ -94,7 +93,7 @@ class OrderController extends ResourceController $this->manager->flush(); if (!$configuration->isHtmlRequest()) { - return $this->viewHandler->handle($configuration, View::create(null, Response::HTTP_NO_CONTENT)); + return $this->createRestView($configuration, null, Response::HTTP_NO_CONTENT); } $this->flashHelper->addSuccessFlash($configuration, ResourceActions::UPDATE, $resource); @@ -108,7 +107,7 @@ class OrderController extends ResourceController } if (!$configuration->isHtmlRequest()) { - return $this->viewHandler->handle($configuration, View::create($form, Response::HTTP_BAD_REQUEST)); + return $this->createRestView($configuration, $form, Response::HTTP_BAD_REQUEST); } return $this->render( @@ -122,7 +121,7 @@ class OrderController extends ResourceController ); } - protected function addFlash(string $type, $message): void + protected function addFlash(string $type, mixed $message): void { /** @var SessionInterface $session */ $session = $this->get('request_stack')->getSession(); diff --git a/src/Sylius/Bundle/PromotionBundle/Controller/PromotionCouponController.php b/src/Sylius/Bundle/PromotionBundle/Controller/PromotionCouponController.php index 4a0ac3af9e..8719756e6d 100644 --- a/src/Sylius/Bundle/PromotionBundle/Controller/PromotionCouponController.php +++ b/src/Sylius/Bundle/PromotionBundle/Controller/PromotionCouponController.php @@ -13,7 +13,6 @@ declare(strict_types=1); namespace Sylius\Bundle\PromotionBundle\Controller; -use FOS\RestBundle\View\View; use Sylius\Bundle\PromotionBundle\Form\Type\PromotionCouponGeneratorInstructionType; use Sylius\Bundle\ResourceBundle\Controller\ResourceController; use Sylius\Component\Promotion\Generator\PromotionCouponGeneratorInterface; @@ -49,7 +48,7 @@ class PromotionCouponController extends ResourceController } if (!$configuration->isHtmlRequest()) { - return $this->viewHandler->handle($configuration, View::create($form)); + return $this->createRestView($configuration, $form); } return $this->render( diff --git a/src/Sylius/Bundle/UserBundle/Controller/UserController.php b/src/Sylius/Bundle/UserBundle/Controller/UserController.php index 99442b4831..55269bdb82 100644 --- a/src/Sylius/Bundle/UserBundle/Controller/UserController.php +++ b/src/Sylius/Bundle/UserBundle/Controller/UserController.php @@ -13,7 +13,6 @@ declare(strict_types=1); namespace Sylius\Bundle\UserBundle\Controller; -use FOS\RestBundle\View\View; use Sylius\Bundle\ResourceBundle\Controller\RequestConfiguration; use Sylius\Bundle\ResourceBundle\Controller\ResourceController; use Sylius\Bundle\UserBundle\Form\Model\ChangePassword; @@ -56,7 +55,7 @@ class UserController extends ResourceController } if (!$configuration->isHtmlRequest()) { - return $this->viewHandler->handle($configuration, View::create($form, Response::HTTP_BAD_REQUEST)); + return $this->createRestView($configuration, $form, Response::HTTP_BAD_REQUEST); } return new Response($this->container->get('twig')->render( @@ -105,7 +104,7 @@ class UserController extends ResourceController } if (!$configuration->isHtmlRequest()) { - return $this->viewHandler->handle($configuration, View::create($form, Response::HTTP_BAD_REQUEST)); + return $this->createRestView($configuration, $form, Response::HTTP_BAD_REQUEST); } return new Response($this->container->get('twig')->render( @@ -128,7 +127,7 @@ class UserController extends ResourceController $user = $this->repository->findOneBy(['emailVerificationToken' => $token]); if (null === $user) { if (!$configuration->isHtmlRequest()) { - return $this->viewHandler->handle($configuration, View::create($configuration, Response::HTTP_BAD_REQUEST)); + return $this->createRestView($configuration, $configuration, Response::HTTP_BAD_REQUEST); } $this->addTranslatedFlash('error', 'sylius.user.verify_email_by_invalid_token'); @@ -148,7 +147,7 @@ class UserController extends ResourceController $eventDispatcher->dispatch(new GenericEvent($user), UserEvents::POST_EMAIL_VERIFICATION); if (!$configuration->isHtmlRequest()) { - return $this->viewHandler->handle($configuration, View::create($user)); + return $this->createRestView($configuration, $user); } $flashMessage = $this->getSyliusAttribute($request, 'flash', 'sylius.user.verify_email'); @@ -165,7 +164,7 @@ class UserController extends ResourceController $user = $this->getUser(); if (null === $user) { if (!$configuration->isHtmlRequest()) { - return $this->viewHandler->handle($configuration, View::create($configuration, Response::HTTP_UNAUTHORIZED)); + return $this->createRestView($configuration, $configuration, Response::HTTP_UNAUTHORIZED); } $this->addTranslatedFlash('notice', 'sylius.user.verify_no_user'); @@ -175,7 +174,7 @@ class UserController extends ResourceController if (null !== $user->getVerifiedAt()) { if (!$configuration->isHtmlRequest()) { - return $this->viewHandler->handle($configuration, View::create($configuration, Response::HTTP_BAD_REQUEST)); + return $this->createRestView($configuration, $configuration, Response::HTTP_BAD_REQUEST); } $this->addTranslatedFlash('notice', 'sylius.user.verify_verified_email'); @@ -193,7 +192,7 @@ class UserController extends ResourceController $eventDispatcher->dispatch(new GenericEvent($user), UserEvents::REQUEST_VERIFICATION_TOKEN); if (!$configuration->isHtmlRequest()) { - return $this->viewHandler->handle($configuration, View::create(null, Response::HTTP_NO_CONTENT)); + return $this->createRestView($configuration, null, Response::HTTP_NO_CONTENT); } $this->addTranslatedFlash('success', 'sylius.user.verify_email_request'); @@ -225,7 +224,7 @@ class UserController extends ResourceController } if (!$configuration->isHtmlRequest()) { - return $this->viewHandler->handle($configuration, View::create(null, Response::HTTP_NO_CONTENT)); + $this->createRestView($configuration, null, Response::HTTP_NO_CONTENT); } $this->addTranslatedFlash('success', 'sylius.user.reset_password_request'); @@ -244,7 +243,7 @@ class UserController extends ResourceController } if (!$configuration->isHtmlRequest()) { - return $this->viewHandler->handle($configuration, View::create($form, Response::HTTP_BAD_REQUEST)); + return $this->createRestView($configuration, $form, Response::HTTP_BAD_REQUEST); } return new Response($this->container->get('twig')->render( @@ -284,7 +283,7 @@ class UserController extends ResourceController $this->manager->flush(); if (!$configuration->isHtmlRequest()) { - return $this->viewHandler->handle($configuration, View::create($user, Response::HTTP_BAD_REQUEST)); + return $this->createRestView($configuration, $user, Response::HTTP_BAD_REQUEST); } $this->addTranslatedFlash('error', 'sylius.user.expire_password_reset_token'); @@ -331,7 +330,7 @@ class UserController extends ResourceController $dispatcher->dispatch(new GenericEvent($user), UserEvents::POST_PASSWORD_RESET); if (!$configuration->isHtmlRequest()) { - return $this->viewHandler->handle($configuration, View::create(null, Response::HTTP_NO_CONTENT)); + return $this->createRestView($configuration, null, Response::HTTP_NO_CONTENT); } $redirectRouteName = $this->getSyliusAttribute($request, 'redirect', null); @@ -357,7 +356,7 @@ class UserController extends ResourceController $dispatcher->dispatch(new GenericEvent($user), UserEvents::POST_PASSWORD_CHANGE); if (!$configuration->isHtmlRequest()) { - return $this->viewHandler->handle($configuration, View::create(null, Response::HTTP_NO_CONTENT)); + return $this->createRestView($configuration, null, Response::HTTP_NO_CONTENT); } $redirectRouteName = $this->getSyliusAttribute($request, 'redirect', null); @@ -381,7 +380,7 @@ class UserController extends ResourceController return null; } - private function getSyliusAttribute(Request $request, string $attribute, $default = null) + private function getSyliusAttribute(Request $request, string $attribute, $default = null): mixed { $attributes = $request->attributes->get('_sylius', []); From 5c66672fec4537fd91e3b001c48d2e9fde0e095c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pysiak?= Date: Fri, 27 Sep 2024 08:03:27 +0200 Subject: [PATCH 5/6] [Shop] Add json login --- config/packages/security.yaml | 6 ++++ .../Resources/config/routing/security.yml | 6 ++++ .../checkout/address/form/user.html.twig | 2 +- .../Controller/SecurityController.php | 32 +++++++++++++------ .../UserBundle/Resources/config/services.xml | 4 +-- 5 files changed, 37 insertions(+), 13 deletions(-) diff --git a/config/packages/security.yaml b/config/packages/security.yaml index 6d0ed92e3f..d010f895b9 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -82,6 +82,12 @@ security: enable_csrf: true csrf_parameter: _csrf_shop_security_token csrf_token_id: shop_authenticate + json_login: + check_path: sylius_shop_json_login_check + username_path: _username + password_path: _password + success_handler: sylius.authentication.success_handler + failure_handler: sylius.authentication.failure_handler remember_me: secret: "%env(APP_SECRET)%" name: APP_SHOP_REMEMBER_ME diff --git a/src/Sylius/Bundle/ShopBundle/Resources/config/routing/security.yml b/src/Sylius/Bundle/ShopBundle/Resources/config/routing/security.yml index eb4785b4ab..c8f2fac527 100644 --- a/src/Sylius/Bundle/ShopBundle/Resources/config/routing/security.yml +++ b/src/Sylius/Bundle/ShopBundle/Resources/config/routing/security.yml @@ -15,6 +15,12 @@ sylius_shop_login_check: methods: [POST] defaults: _controller: sylius.controller.security::checkAction + +sylius_shop_json_login_check: + path: /json-login-check + methods: [POST] + defaults: + _controller: sylius.controller.security::jsonLoginCheck sylius_shop_logout: path: /logout diff --git a/src/Sylius/Bundle/ShopBundle/templates/checkout/address/form/user.html.twig b/src/Sylius/Bundle/ShopBundle/templates/checkout/address/form/user.html.twig index 8200f0c824..2e2846f746 100644 --- a/src/Sylius/Bundle/ShopBundle/templates/checkout/address/form/user.html.twig +++ b/src/Sylius/Bundle/ShopBundle/templates/checkout/address/form/user.html.twig @@ -1,7 +1,7 @@ {% set form = hookable_metadata.context.form %} {% if form.customer is defined %} -
+
diff --git a/src/Sylius/Bundle/UserBundle/Controller/SecurityController.php b/src/Sylius/Bundle/UserBundle/Controller/SecurityController.php index 4f058f3c09..b317105167 100644 --- a/src/Sylius/Bundle/UserBundle/Controller/SecurityController.php +++ b/src/Sylius/Bundle/UserBundle/Controller/SecurityController.php @@ -14,18 +14,19 @@ declare(strict_types=1); namespace Sylius\Bundle\UserBundle\Controller; use Sylius\Bundle\UserBundle\Form\Type\UserLoginType; -use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; +use Twig\Environment; use Webmozart\Assert\Assert; -class SecurityController extends AbstractController +readonly class SecurityController { public function __construct( - private readonly AuthenticationUtils $authenticationUtils, - private readonly FormFactoryInterface $formFactory, + private AuthenticationUtils $authenticationUtils, + private FormFactoryInterface $formFactory, + private Environment $twig, ) { } @@ -46,11 +47,16 @@ class SecurityController extends AbstractController $form = $this->formFactory->createNamed('', $formType); - return $this->render($template, [ - 'form' => $form->createView(), - 'last_username' => $lastUsername, - 'error' => $error, - ]); + return new Response( + $this->twig->render( + $template, + [ + 'form' => $form->createView(), + 'last_username' => $lastUsername, + 'error' => $error, + ], + ), + ); } /** @@ -61,6 +67,14 @@ class SecurityController extends AbstractController throw new \RuntimeException('You must configure the check path to be handled by the firewall.'); } + /** + * Login check action. This action should never be called. + */ + public function jsonLoginCheck(): Response + { + throw new \RuntimeException('You must configure the check path to be handled by the firewall.'); + } + /** * Logout action. This action should never be called. */ diff --git a/src/Sylius/Bundle/UserBundle/Resources/config/services.xml b/src/Sylius/Bundle/UserBundle/Resources/config/services.xml index 6bb325c36f..7a82443d80 100644 --- a/src/Sylius/Bundle/UserBundle/Resources/config/services.xml +++ b/src/Sylius/Bundle/UserBundle/Resources/config/services.xml @@ -47,9 +47,7 @@ - - - + From 54a2a5cc65fb54f377cf3fcc7e43d2608615f4e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pysiak?= Date: Fri, 27 Sep 2024 10:39:58 +0200 Subject: [PATCH 6/6] [Admin] Fix product in taxon (and variant) positions --- .../CoreBundle/Controller/ProductTaxonController.php | 10 ++++++---- .../CoreBundle/Controller/ProductVariantController.php | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Sylius/Bundle/CoreBundle/Controller/ProductTaxonController.php b/src/Sylius/Bundle/CoreBundle/Controller/ProductTaxonController.php index 77c96f0af1..07ef09b835 100644 --- a/src/Sylius/Bundle/CoreBundle/Controller/ProductTaxonController.php +++ b/src/Sylius/Bundle/CoreBundle/Controller/ProductTaxonController.php @@ -29,11 +29,13 @@ class ProductTaxonController extends ResourceController { public function updateProductTaxonsPositionsAction(Request $request): Response { + $data = json_decode($request->getContent(), true); + $configuration = $this->requestConfigurationFactory->create($this->metadata, $request); - $this->validateCsrfProtection($request, $configuration); + $this->validateCsrfProtection($data['_csrf_token'] ?? [], $configuration); $this->isGrantedOr403($configuration, ResourceActions::UPDATE); - $productTaxonsPositions = $request->request->all('productTaxons'); + $productTaxonsPositions = $data['productTaxons'] ?? []; $productTaxonsPositions = array_combine( array_column($productTaxonsPositions, 'id'), array_column($productTaxonsPositions, 'position'), @@ -98,9 +100,9 @@ class ProductTaxonController extends ResourceController return $this->repository->count(['taxon' => $productTaxon->getTaxon()]) - 1; } - private function validateCsrfProtection(Request $request, RequestConfiguration $configuration): void + private function validateCsrfProtection(string $csrfToken, RequestConfiguration $configuration): void { - if ($configuration->isCsrfProtectionEnabled() && !$this->isCsrfTokenValid('update-product-taxon-position', (string) $request->request->get('_csrf_token'))) { + if ($configuration->isCsrfProtectionEnabled() && !$this->isCsrfTokenValid('update-product-taxon-position', $csrfToken)) { throw new HttpException(Response::HTTP_FORBIDDEN, 'Invalid csrf token.'); } } diff --git a/src/Sylius/Bundle/CoreBundle/Controller/ProductVariantController.php b/src/Sylius/Bundle/CoreBundle/Controller/ProductVariantController.php index 8b7d877fd7..a7cbf37044 100644 --- a/src/Sylius/Bundle/CoreBundle/Controller/ProductVariantController.php +++ b/src/Sylius/Bundle/CoreBundle/Controller/ProductVariantController.php @@ -28,11 +28,13 @@ class ProductVariantController extends ResourceController */ public function updatePositionsAction(Request $request): Response { + $data = json_decode($request->getContent(), true); + $configuration = $this->requestConfigurationFactory->create($this->metadata, $request); $this->isGrantedOr403($configuration, ResourceActions::UPDATE); - $productVariantsToUpdate = $request->request->all('productVariants'); + $productVariantsToUpdate = $data['productVariants'] ?? []; - if ($configuration->isCsrfProtectionEnabled() && !$this->isCsrfTokenValid('update-product-variant-position', (string) $request->request->get('_csrf_token'))) { + if ($configuration->isCsrfProtectionEnabled() && !$this->isCsrfTokenValid('update-product-variant-position', $data['_csrf_token'] ?? '')) { throw new HttpException(Response::HTTP_FORBIDDEN, 'Invalid csrf token.'); }