Skip to content

Commit

Permalink
Merge pull request #8 from webgriffe/issue-7
Browse files Browse the repository at this point in the history
Upgrade for Sylius 1.10 and PHP 8.0 (#7)
  • Loading branch information
LucaGallinari authored Dec 1, 2021
2 parents 6da8d91 + 7346c27 commit a2b75f3
Show file tree
Hide file tree
Showing 26 changed files with 456 additions and 96 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [7.4, 7.3]
symfony: [ ^4.4, ^5.2 ]
sylius: [ ~1.8.0, ~1.9.0 ]
node: [10.x]
mysql: [5.7]
php: ["8.0", "7.4"]
symfony: ["^4.4", "^5.2"]
sylius: ["~1.9.0", "~1.10.0@alpha"]
node: ["10.x"]
mysql: ["8.0"]

exclude:
-
sylius: ~1.8.0
symfony: ^5.2
php: "8.0"
sylius: "~1.9.0"


env:
APP_ENV: test
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

## Requirements

* PHP `^7.3`
* Sylius `^1.8`
* PHP `^7.4 || ^8.0`
* Sylius `^1.9 || ^1.10`

## Installation

Expand Down
145 changes: 73 additions & 72 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,76 @@
{
"name": "webgriffe/sylius-upgrade-plugin",
"type": "sylius-plugin",
"keywords": ["sylius", "sylius-plugin"],
"description": "Helps you upgrade your Sylius app to a new version.",
"license": "MIT",
"require": {
"php": "^7.3",
"sylius/sylius": "~1.8.0 || ~1.9.0",
"webmozart/glob": "^4.3"
},
"conflict": {
"api-platform/core": "^2.6",
"doctrine/dbal": "^3"
},
"require-dev": {
"behat/behat": "^3.6.1",
"behat/mink-selenium2-driver": "^1.4",
"dmore/behat-chrome-extension": "^1.3",
"dmore/chrome-mink-driver": "^2.7",
"friends-of-behat/mink": "^1.8",
"friends-of-behat/mink-browserkit-driver": "^1.4",
"friends-of-behat/mink-extension": "^2.4",
"friends-of-behat/page-object-extension": "^0.3",
"friends-of-behat/suite-settings-extension": "^1.0",
"friends-of-behat/symfony-extension": "^2.1",
"friends-of-behat/variadic-extension": "^1.3",
"friendsofsymfony/oauth-server-bundle": "^1.6 || >2.0.0-alpha.0 ^2.0@dev",
"lakion/mink-debug-extension": "^2.0.0",
"mikey179/vfsstream": "^1.6",
"phpspec/phpspec": "^7.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "0.12.82",
"phpstan/phpstan-doctrine": "0.12.33",
"phpstan/phpstan-strict-rules": "^0.12.0",
"phpstan/phpstan-webmozart-assert": "0.12.12",
"phpunit/phpunit": "^9.5",
"sensiolabs/security-checker": "^6.0",
"sylius-labs/coding-standard": "^4.0",
"symfony/browser-kit": "^4.4 || ^5.2",
"symfony/debug-bundle": "^4.4 || ^5.2",
"symfony/dotenv": "^4.4 || ^5.2",
"symfony/intl": "^4.4 || ^5.2",
"symfony/web-profiler-bundle": "^4.4 || ^5.2",
"vimeo/psalm": "4.6.4"
},
"autoload": {
"psr-4": {
"Webgriffe\\SyliusUpgradePlugin\\": "src/",
"Tests\\Webgriffe\\SyliusUpgradePlugin\\": "tests/"
}
},
"autoload-dev": {
"classmap": ["tests/Application/Kernel.php"]
},
"extra": {
"branch-alias": {
"dev-master": "1.8-dev"
}
},
"config": {
"sort-packages": true
},
"scripts": {
"post-install-cmd": [
"php bin/create_node_symlink.php"
],
"post-update-cmd": [
"php bin/create_node_symlink.php"
],
"post-create-project-cmd": [
"php bin/create_node_symlink.php"
]
"name": "webgriffe/sylius-upgrade-plugin",
"type": "sylius-plugin",
"keywords": [
"sylius",
"sylius-plugin"
],
"description": "Helps you upgrade your Sylius app to a new version.",
"license": "MIT",
"require": {
"php": "^7.4 || ^8.0",
"sylius/sylius": "~1.9.0 || ~1.10.0@beta",
"webmozart/glob": "^4.3"
},
"require-dev": {
"behat/behat": "^3.6.1",
"behat/mink-selenium2-driver": "^1.4",
"dmore/behat-chrome-extension": "^1.3",
"dmore/chrome-mink-driver": "^2.7",
"friends-of-behat/mink": "^1.8",
"friends-of-behat/mink-browserkit-driver": "^1.4",
"friends-of-behat/mink-debug-extension": "^2.0.0",
"friends-of-behat/mink-extension": "^2.4",
"friends-of-behat/page-object-extension": "^0.3",
"friends-of-behat/suite-settings-extension": "^1.0",
"friends-of-behat/symfony-extension": "^2.1",
"friends-of-behat/variadic-extension": "^1.3",
"friendsofsymfony/oauth-server-bundle": "^1.6 || >2.0.0-alpha.0 ^2.0@dev",
"mikey179/vfsstream": "^1.6",
"phpspec/phpspec": "^7.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "0.12.85",
"phpstan/phpstan-doctrine": "0.12.33",
"phpstan/phpstan-strict-rules": "^0.12.0",
"phpstan/phpstan-webmozart-assert": "0.12.12",
"phpunit/phpunit": "^9.5",
"sensiolabs/security-checker": "^6.0",
"sylius-labs/coding-standard": "^4.0",
"symfony/browser-kit": "^4.4 || ^5.2",
"symfony/debug-bundle": "^4.4 || ^5.2",
"symfony/dotenv": "^4.4 || ^5.2",
"symfony/intl": "^4.4 || ^5.2",
"symfony/web-profiler-bundle": "^4.4 || ^5.2",
"vimeo/psalm": "4.7.1"
},
"autoload": {
"psr-4": {
"Webgriffe\\SyliusUpgradePlugin\\": "src/",
"Tests\\Webgriffe\\SyliusUpgradePlugin\\": "tests/"
}
},
"autoload-dev": {
"classmap": [
"tests/Application/Kernel.php"
]
},
"extra": {
"branch-alias": {
"dev-master": "1.10-dev"
}
},
"config": {
"sort-packages": true
},
"scripts": {
"post-install-cmd": [
"php bin/create_node_symlink.php"
],
"post-update-cmd": [
"php bin/create_node_symlink.php"
],
"post-create-project-cmd": [
"php bin/create_node_symlink.php"
]
}
}
4 changes: 0 additions & 4 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

declare(strict_types=1);

use PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\ValueObject\Option;

return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->import('vendor/sylius-labs/coding-standard/ecs.php');

// temporary fix for https://github.com/SyliusLabs/CodingStandard/pull/40
$containerConfigurator->services()->set(ClassAttributesSeparationFixer::class);

$parameters = $containerConfigurator->parameters();
$parameters->set(Option::PATHS, [__DIR__ . '/src']);
};
5 changes: 4 additions & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@

final class Configuration implements ConfigurationInterface
{
/**
* @psalm-suppress UnusedVariable
*/
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('acme_sylius_example_plugin');
$treeBuilder = new TreeBuilder('webgriffe_sylius_upgrade_plugin');
$rootNode = $treeBuilder->getRootNode();

return $treeBuilder;
Expand Down
3 changes: 3 additions & 0 deletions src/DependencyInjection/WebgriffeSyliusUpgradeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

final class WebgriffeSyliusUpgradeExtension extends Extension
{
/**
* @psalm-suppress UnusedVariable
*/
public function load(array $configs, ContainerBuilder $container): void
{
$config = $this->processConfiguration($this->getConfiguration([], $container), $configs);
Expand Down
2 changes: 1 addition & 1 deletion tests/Application/.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ APP_SECRET=EDITME
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls
DATABASE_URL=mysql://[email protected]/acme_sylius_example_plugin_%kernel.environment%?serverVersion=5.5
DATABASE_URL=mysql://[email protected]/webgriffe_sylius_upgrade_plugin_%kernel.environment%?serverVersion=5.7
###< doctrine/doctrine-bundle ###

###> lexik/jwt-authentication-bundle ###
Expand Down
2 changes: 0 additions & 2 deletions tests/Application/config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
Sylius\Bundle\ThemeBundle\SyliusThemeBundle::class => ['all' => true],
Sylius\Bundle\AdminBundle\SyliusAdminBundle::class => ['all' => true],
Sylius\Bundle\ShopBundle\SyliusShopBundle::class => ['all' => true],
FOS\OAuthServerBundle\FOSOAuthServerBundle::class => ['all' => true],
Sylius\Bundle\AdminApiBundle\SyliusAdminApiBundle::class => ['all' => true],
Webgriffe\SyliusUpgradePlugin\WebgriffeSyliusUpgradePlugin::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],
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: "@SyliusShopBundle/Resources/config/app/config.yml" }

Expand Down
6 changes: 6 additions & 0 deletions tests/Application/config/sylius/1.10/bundles.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

return [
BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true],
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
jms_serializer:
visitors:
json_serialization:
options:
- JSON_PRETTY_PRINT
- JSON_UNESCAPED_SLASHES
- JSON_PRESERVE_ZERO_FRACTION
json_deserialization:
options:
- JSON_PRETTY_PRINT
- JSON_UNESCAPED_SLASHES
- JSON_PRESERVE_ZERO_FRACTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
jms_serializer:
visitors:
xml_serialization:
format_output: '%kernel.debug%'
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
jms_serializer:
visitors:
json_serialization:
options:
- JSON_UNESCAPED_SLASHES
- JSON_PRESERVE_ZERO_FRACTION
json_deserialization:
options:
- JSON_UNESCAPED_SLASHES
- JSON_PRESERVE_ZERO_FRACTION
Loading

0 comments on commit a2b75f3

Please sign in to comment.