Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Maintenance] Support for Sylius 1.8 dropped, Sylius 1.10 added, Symfony 5.3 added, PHP 8.0 added #717

Merged
merged 6 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,15 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [7.4, 7.3]
php: [7.4, 8.0]
node: [10.x]
mysql: [5.7, 8.0]
symfony: [^4.4, ^5.2]
sylius: [~1.8.0, ~1.9.0]

symfony: [^4.4, ~5.2.0, ~5.3.0]
sylius: [~1.9.0, ~1.10.0]
exclude:
- # PHP 7.3 does not support "caching_sha2_password" authentication plugin which is a default one in MySQL 8.0
php: 7.3
mysql: 8.0
-
sylius: ~1.8.0
symfony: ^5.2
- # Sylius 1.9 does not support PHP 8.0
sylius: ~1.9.0
php: 8.0

env:
APP_ENV: test
Expand Down Expand Up @@ -117,7 +113,3 @@ jobs:
-
name: Run PHPUnit
run: vendor/bin/phpunit --colors=always

-
name: Run Doc Parser
run: vendor/bin/doc-parser doc/Cookbook.md
17 changes: 8 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"description": "Shop API for Sylius E-Commerce.",
"license": "MIT",
"require": {
"php": "^7.3",
"sylius/sylius": "^1.8",
"php": "^7.4|^8.0",
"sylius/sylius": "^1.9",
"lexik/jwt-authentication-bundle": "^2.5",
"symfony/messenger": "^4.4|5.2",
"symfony/messenger": "^4.4|^5.2",
"doctrine/doctrine-bundle": "^2.0",
"friendsofsymfony/oauth-server-bundle": ">2.0.0-alpha.0 ^2.0@dev"
},
Expand All @@ -16,15 +16,14 @@
"matthiasnoback/symfony-config-test": "^4.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.0",
"phpspec/phpspec": "^7.0",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan": "0.12.90",
"phpstan/phpstan-webmozart-assert": "^0.12",
"phpunit/phpunit": "^9.0",
"sylius-labs/coding-standard": "^3.0",
"symfony/debug-bundle": "^4.4|5.2",
"symfony/dotenv": "^4.4|5.2",
"symfony/web-profiler-bundle": "^4.4|5.2",
"symfony/web-server-bundle": "^4.4",
"mamazu/documentation-validator": "^1.0.1"
"symfony/debug-bundle": "^4.4|^5.2",
"symfony/dotenv": "^4.4|^5.2",
"symfony/web-profiler-bundle": "^4.4|^5.2",
"symfony/web-server-bundle": "^4.4"
},
"autoload": {
"psr-4": {
Expand Down
5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ parameters:
- /^Access to an undefined property Symfony\\Component\\Validator\\Constraint::\$message\.$/
- '/Sylius\\Component\\Core\\Model\\(\w+), Sylius\\Component\\\w+\\Model\\\1 given\./'
- '/Call to static method Webmozart\\Assert\\Assert::implementsInterface\(\) with string/'
- '/Empty array passed to foreach./'
- '/Property Sylius\\ShopApiPlugin\\Request\\Checkout\\AddressOrderRequest::\$\w+Address \(array\|null\) does not accept bool\|float\|int\|string\|null\./'
- '/Property Sylius\\ShopApiPlugin\\Request\\Customer\\UpdateCustomerRequest::\$birthday \(DateTimeImmutable\|null\) does not accept bool\|float\|int\|string\|null\./'
- '/Parameter #3 \$options of class Sylius\\ShopApiPlugin\\Request\\Cart\\PutOptionBasedConfigurableItemToCartRequest constructor expects array\|null, bool\|float\|int\|string\|null given\./'
- '/Argument of an invalid type bool\|float\|int\|string supplied for foreach, only iterables are supported\./'
2 changes: 0 additions & 2 deletions tests/Application/config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
Sylius\Bundle\ThemeBundle\SyliusThemeBundle::class => ['all' => true],
Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['all' => true],
Sylius\Bundle\AdminBundle\SyliusAdminBundle::class => ['all' => true],
FOS\OAuthServerBundle\FOSOAuthServerBundle::class => ['all' => true],
Sylius\Bundle\AdminApiBundle\SyliusAdminApiBundle::class => ['all' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
Sylius\ShopApiPlugin\SyliusShopApiPlugin::class => ['all' => true],
Expand Down
1 change: 0 additions & 1 deletion tests/Application/config/packages/_sylius.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ imports:
- { resource: "@SyliusCoreBundle/Resources/config/app/config.yml" }

- { resource: "@SyliusAdminBundle/Resources/config/app/config.yml" }
- { resource: "@SyliusAdminApiBundle/Resources/config/app/config.yml" }

- { resource: "@SyliusShopApiPlugin/Resources/config/app/config.yml" }
- { resource: "@SyliusShopApiPlugin/Resources/config/app/sylius_mailer.yml" }
Expand Down
14 changes: 0 additions & 14 deletions tests/Application/config/packages/security.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
parameters:
sylius.security.admin_regex: "^/%sylius_admin.path_name%"
sylius.security.api_regex: "^/api"
sylius_shop_api.security.regex: "^/shop-api"

security:
Expand Down Expand Up @@ -40,17 +39,6 @@ security:
target: sylius_admin_login
anonymous: true

oauth_token:
pattern: "%sylius.security.api_regex%/oauth/v2/token"
security: false

api:
pattern: "%sylius.security.api_regex%/.*"
provider: sylius_admin_user_provider
fos_oauth: true
stateless: true
anonymous: true

sylius_shop_api:
pattern: "%sylius_shop_api.security.regex%"
stateless: true
Expand All @@ -75,7 +63,5 @@ security:
- { path: "%sylius.security.admin_regex%/_partial", role: ROLE_NO_ACCESS }

- { path: "%sylius.security.admin_regex%/login", role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: "%sylius.security.api_regex%/login", role: IS_AUTHENTICATED_ANONYMOUSLY }

- { path: "%sylius.security.admin_regex%", role: ROLE_ADMINISTRATION_ACCESS }
- { path: "%sylius.security.api_regex%/.*", role: ROLE_API_ACCESS }
3 changes: 0 additions & 3 deletions tests/Application/config/routes/sylius_admin_api.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion tests/Controller/Customer/LoginApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function it_does_not_blow_up_if_empty_carts_exists_in_database(): void
$this->assertResponse($response, 'customer/customer_log_in_response', Response::HTTP_OK);
}

protected function getContainer(): ContainerInterface
protected static function getContainer(): ContainerInterface
{
return static::$sharedKernel->getContainer();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Controller/Customer/RegisterApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function it_does_not_allow_to_register_in_shop_without_passing_required_d
$this->assertResponse($response, 'customer/validation_registration_data_response', Response::HTTP_BAD_REQUEST);
}

protected function getContainer(): ContainerInterface
protected static function getContainer(): ContainerInterface
{
return static::$sharedKernel->getContainer();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function it_allow_to_reset_user_password_without_sending_mail_user_not_ex
$this->assertResponseCode($response, Response::HTTP_NO_CONTENT);
}

protected function getContainer(): ContainerInterface
protected static function getContainer(): ContainerInterface
{
return static::$sharedKernel->getContainer();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function it_does_not_allow_to_resend_verification_email_if_customer_does_
$this->assertResponse($response, 'customer/validation_email_not_found_response', Response::HTTP_BAD_REQUEST);
}

protected function getContainer(): ContainerInterface
protected static function getContainer(): ContainerInterface
{
return static::$sharedKernel->getContainer();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Controller/Customer/ResetPasswordApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function it_allows_to_reset_customer_password(): void
$this->assertResponseCode($response, Response::HTTP_NO_CONTENT);
}

protected function getContainer(): ContainerInterface
protected static function getContainer(): ContainerInterface
{
return static::$sharedKernel->getContainer();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Controller/Customer/VerifyApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private function verifyAccount(?string $token): Response
return $this->client->getResponse();
}

protected function getContainer(): ContainerInterface
protected static function getContainer(): ContainerInterface
{
return static::$sharedKernel->getContainer();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Controller/Utils/PurgeSpooledMessagesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

trait PurgeSpooledMessagesTrait
{
abstract protected function getContainer(): ContainerInterface;
abstract protected static function getContainer(): ContainerInterface;

/**
* @before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@
"ROLE_USER"
],
"enabled": true
},
"_links": {
"self": {
"href": "@[email protected]('/api/v1/customers/')"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
"ROLE_USER"
],
"enabled": true
},
"_links": {
"self": {
"href": "@[email protected]('/api/v1/customers/')"
}
}
}
},
Expand Down Expand Up @@ -71,11 +66,6 @@
"ROLE_USER"
],
"enabled": true
},
"_links": {
"self": {
"href": "@[email protected]('/api/v1/customers/')"
}
}
}
},
Expand Down Expand Up @@ -111,11 +101,6 @@
"ROLE_USER"
],
"enabled": true
},
"_links": {
"self": {
"href": "@[email protected]('/api/v1/customers/')"
}
}
}
}
Expand Down