Skip to content

Commit 5f8825f

Browse files
committed
Upgrade to Sylius 1.11
1 parent ce1237a commit 5f8825f

34 files changed

+57
-574
lines changed

.github/workflows/build.yml

+4-10
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,12 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
php: ["8.0", "7.4"]
25-
symfony: ["^4.4", "^5.2"]
26-
sylius: ["~1.9.0", "~1.10.0@alpha"]
27-
node: ["10.x"]
24+
php: ["8.0"]
25+
symfony: ["5.4.*"]
26+
sylius: ["^1.11.2"]
27+
node: ["14.x"]
2828
mysql: ["8.0"]
2929

30-
exclude:
31-
-
32-
php: "8.0"
33-
sylius: "~1.9.0"
34-
35-
3630
env:
3731
APP_ENV: test
3832
DATABASE_URL: "mysql://root:[email protected]/sylius?serverVersion=${{ matrix.mysql }}"

UPGRADE.md

-122
This file was deleted.

composer.json

+11-10
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
],
99
"license": "MIT",
1010
"require": {
11-
"php": "^7.4 || ^8.0",
11+
"php": "^8.0",
1212
"sandwich/vies-bundle": "^2.1",
13-
"sylius/sylius": "~1.9.0 || ~1.10.0@beta",
13+
"sylius/sylius": "^1.11.2",
1414
"webmozart/assert": "^1.9"
1515
},
1616
"require-dev": {
@@ -29,19 +29,20 @@
2929
"friendsofsymfony/oauth-server-bundle": "^1.6 || >2.0.0-alpha.0 ^2.0@dev",
3030
"phpspec/phpspec": "^7.0",
3131
"phpstan/extension-installer": "^1.0",
32-
"phpstan/phpstan": "0.12.85",
32+
"phpstan/phpstan": "0.12.99",
3333
"phpstan/phpstan-doctrine": "0.12.33",
3434
"phpstan/phpstan-strict-rules": "^0.12.0",
3535
"phpstan/phpstan-webmozart-assert": "0.12.12",
3636
"phpunit/phpunit": "^9.5",
3737
"sensiolabs/security-checker": "^6.0",
3838
"sylius-labs/coding-standard": "^4.0",
39-
"symfony/browser-kit": "^4.4 || ^5.2",
40-
"symfony/debug-bundle": "^4.4 || ^5.2",
41-
"symfony/dotenv": "^4.4 || ^5.2",
42-
"symfony/intl": "^4.4 || ^5.2",
43-
"symfony/web-profiler-bundle": "^4.4 || ^5.2",
44-
"vimeo/psalm": "4.7.1"
39+
"symfony/browser-kit": "^5.4",
40+
"symfony/debug-bundle": "^5.4",
41+
"symfony/dotenv": "^5.4",
42+
"symfony/intl": "^5.4",
43+
"symfony/web-profiler-bundle": "^5.4",
44+
"vimeo/psalm": "4.7.1",
45+
"polishsymfonycommunity/symfony-mocker-container": "^1.0"
4546
},
4647
"config": {
4748
"sort-packages": true,
@@ -53,7 +54,7 @@
5354
},
5455
"extra": {
5556
"branch-alias": {
56-
"dev-master": "1.10-dev"
57+
"dev-master": "1.11-dev"
5758
}
5859
},
5960
"autoload": {

tests/Application/.env

+7
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,10 @@ JWT_PASSPHRASE=acme_plugin_development
2727
# Delivery is disabled by default via "null://localhost"
2828
MAILER_URL=smtp://localhost
2929
###< symfony/swiftmailer-bundle ###
30+
31+
###> symfony/messenger ###
32+
# Choose one of the transports below
33+
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
34+
MESSENGER_TRANSPORT_DSN=doctrine://default
35+
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
36+
###< symfony/messenger ###

tests/Application/Kernel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function configureRoutes(RouteCollectionBuilder $routes): void
6767

6868
protected function getContainerBaseClass(): string
6969
{
70-
if ($this->isTestEnvironment()) {
70+
if ($this->isTestEnvironment() && class_exists(MockerContainer::class)) {
7171
return MockerContainer::class;
7272
}
7373

tests/Application/config/api_platform/.gitignore

Whitespace-only changes.

tests/Application/config/bundles.php

+3
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,7 @@
5555
SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true],
5656
Sandwich\ViesBundle\SandwichViesBundle::class => ['all' => true],
5757
Webgriffe\SyliusItalianInvoiceableOrderPlugin\WebgriffeSyliusItalianInvoiceableOrderPlugin::class => ['all' => true],
58+
BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
59+
SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true],
60+
Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true],
5861
];

tests/Application/config/packages/_sylius.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ sylius_shop:
1414
product_grid:
1515
include_all_descendants: true
1616

17+
sylius_api:
18+
enabled: true
19+
1720
sylius_addressing:
1821
resources:
1922
address:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
api_platform:
2+
mapping:
3+
paths:
4+
- '%kernel.project_dir%/../../vendor/sylius/sylius/src/Sylius/Bundle/ApiBundle/Resources/config/api_resources'
5+
- '%kernel.project_dir%/config/api_platform'
6+
- '%kernel.project_dir%/src/Entity'
7+
patch_formats:
8+
json: ['application/merge-patch+json']
9+
swagger:
10+
versions: [3]

tests/Application/config/packages/fos_rest.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ fos_rest:
77
empty_content: 204
88
format_listener:
99
rules:
10-
- { path: '^/api/.*', priorities: ['json', 'xml'], fallback_format: json, prefer_extension: true }
10+
- { path: '^/api/v1/.*', priorities: ['json', 'xml'], fallback_format: json, prefer_extension: true }
1111
- { path: '^/', stop: true }

tests/Application/config/packages/framework.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ framework:
44
csrf_protection: true
55
session:
66
handler_id: ~
7+
serializer:
8+
mapping:
9+
paths: [ '%kernel.project_dir%/config/serialization' ]

tests/Application/config/sylius/1.10/packages/security.yaml tests/Application/config/packages/security.yaml

+14-32
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
parameters:
2-
sylius.security.admin_regex: "^/%sylius_admin.path_name%"
3-
sylius.security.api_regex: "^/api"
4-
sylius.security.shop_regex: "^/(?!%sylius_admin.path_name%|new-api|api/.*|api$|media/.*)[^/]++"
5-
sylius.security.new_api_route: "/new-api"
6-
sylius.security.new_api_regex: "^%sylius.security.new_api_route%"
7-
sylius.security.new_api_admin_route: "%sylius.security.new_api_route%/admin"
8-
sylius.security.new_api_admin_regex: "^%sylius.security.new_api_admin_route%"
9-
sylius.security.new_api_shop_route: "%sylius.security.new_api_route%/shop"
10-
sylius.security.new_api_shop_regex: "^%sylius.security.new_api_shop_route%"
11-
121
security:
132
always_authenticate_before_granting: true
143
providers:
@@ -20,9 +9,6 @@ security:
209
id: sylius.shop_user_provider.email_or_name_based
2110
sylius_api_shop_user_provider:
2211
id: sylius.shop_user_provider.email_or_name_based
23-
sylius_api_chain_provider:
24-
chain:
25-
providers: [sylius_api_shop_user_provider, sylius_api_admin_user_provider]
2612

2713
encoders:
2814
Sylius\Component\User\Model\UserInterface: argon2i
@@ -55,12 +41,12 @@ security:
5541
anonymous: true
5642

5743
new_api_admin_user:
58-
pattern: "%sylius.security.new_api_route%/admin-user-authentication-token"
59-
provider: sylius_admin_user_provider
44+
pattern: "%sylius.security.new_api_admin_regex%/.*"
45+
provider: sylius_api_admin_user_provider
6046
stateless: true
6147
anonymous: true
6248
json_login:
63-
check_path: "%sylius.security.new_api_route%/admin-user-authentication-token"
49+
check_path: "%sylius.security.new_api_admin_route%/authentication-token"
6450
username_path: email
6551
password_path: password
6652
success_handler: lexik_jwt_authentication.handler.authentication_success
@@ -70,12 +56,12 @@ security:
7056
- lexik_jwt_authentication.jwt_token_authenticator
7157

7258
new_api_shop_user:
73-
pattern: "%sylius.security.new_api_route%/shop-user-authentication-token"
74-
provider: sylius_shop_user_provider
59+
pattern: "%sylius.security.new_api_shop_regex%/.*"
60+
provider: sylius_api_shop_user_provider
7561
stateless: true
7662
anonymous: true
7763
json_login:
78-
check_path: "%sylius.security.new_api_route%/shop-user-authentication-token"
64+
check_path: "%sylius.security.new_api_shop_route%/authentication-token"
7965
username_path: email
8066
password_path: password
8167
success_handler: lexik_jwt_authentication.handler.authentication_success
@@ -84,15 +70,6 @@ security:
8470
authenticators:
8571
- lexik_jwt_authentication.jwt_token_authenticator
8672

87-
new_api:
88-
pattern: "%sylius.security.new_api_regex%/*"
89-
provider: sylius_api_chain_provider
90-
stateless: true
91-
anonymous: lazy
92-
guard:
93-
authenticators:
94-
- lexik_jwt_authentication.jwt_token_authenticator
95-
9673
shop:
9774
switch_user: { role: ROLE_ALLOWED_TO_SWITCH }
9875
context: shop
@@ -124,7 +101,11 @@ security:
124101
anonymous: true
125102

126103
dev:
127-
pattern: ^/(_(profiler|wdt)|css|images|js)/
104+
pattern: ^/(_(profiler|wdt)|css|images|js)/
105+
security: false
106+
107+
image_resolver:
108+
pattern: ^/media/cache/resolve
128109
security: false
129110

130111
access_control:
@@ -134,15 +115,16 @@ security:
134115
- { path: "%sylius.security.shop_regex%/_partial", role: ROLE_NO_ACCESS }
135116

136117
- { path: "%sylius.security.admin_regex%/login", role: IS_AUTHENTICATED_ANONYMOUSLY }
137-
- { path: "%sylius.security.api_regex%/login", role: IS_AUTHENTICATED_ANONYMOUSLY }
138118
- { path: "%sylius.security.shop_regex%/login", role: IS_AUTHENTICATED_ANONYMOUSLY }
139119

140120
- { path: "%sylius.security.shop_regex%/register", role: IS_AUTHENTICATED_ANONYMOUSLY }
141121
- { path: "%sylius.security.shop_regex%/verify", role: IS_AUTHENTICATED_ANONYMOUSLY }
142122

143123
- { path: "%sylius.security.admin_regex%", role: ROLE_ADMINISTRATION_ACCESS }
144-
- { path: "%sylius.security.api_regex%/.*", role: ROLE_API_ACCESS }
145124
- { path: "%sylius.security.shop_regex%/account", role: ROLE_USER }
146125

147126
- { path: "%sylius.security.new_api_admin_regex%/.*", role: ROLE_API_ACCESS }
127+
- { path: "%sylius.security.new_api_admin_route%/authentication-token", role: IS_AUTHENTICATED_ANONYMOUSLY }
128+
- { path: "%sylius.security.new_api_user_account_regex%/.*", role: ROLE_USER }
129+
- { path: "%sylius.security.new_api_shop_route%/authentication-token", role: IS_AUTHENTICATED_ANONYMOUSLY }
148130
- { path: "%sylius.security.new_api_shop_regex%/.*", role: IS_AUTHENTICATED_ANONYMOUSLY }

tests/Application/config/serialization/.gitignore

Whitespace-only changes.

tests/Application/config/sylius/1.10/bundles.php

-6
This file was deleted.

tests/Application/config/sylius/1.8/bundles.php

-8
This file was deleted.

tests/Application/config/sylius/1.8/packages/_sylius.yaml

-2
This file was deleted.

tests/Application/config/sylius/1.8/packages/dev/jms_serializer.yaml

-7
This file was deleted.

tests/Application/config/sylius/1.8/packages/jms_serializer.yaml

-4
This file was deleted.

0 commit comments

Comments
 (0)