Skip to content

Commit 15da759

Browse files
authored
Sylius 1.12 support with S5 + S6 (#116)
1 parent 605d525 commit 15da759

21 files changed

+66
-140
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
php: ["8.1", "8.0"]
25-
symfony: ["^5.2"]
26-
sylius: ["~1.11.0"]
25+
symfony: ["^5.2", "^6.0"]
26+
sylius: ["~1.12.0"]
2727
node: ["14.x"]
2828
mysql: ["8.0"]
2929

@@ -85,7 +85,8 @@ jobs:
8585
name: Restrict Symfony version
8686
if: matrix.symfony != ''
8787
run: |
88-
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
88+
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^2.2"
89+
composer global config --no-plugins allow-plugins.symfony/flex true
8990
composer config extra.symfony.require "${{ matrix.symfony }}"
9091
9192
-

composer.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
"sylius-plugin"
99
],
1010
"require": {
11-
"sylius/sylius": "^1.11",
12-
"xynnn/google-tag-manager-bundle": "^3.0"
11+
"sylius/sylius": "^1.12",
12+
"sylius/mailer-bundle": "^1.8 || ^v2.0.0-BETA.1",
13+
"xynnn/google-tag-manager-bundle": "^3.1 || ^4.0"
1314
},
1415
"require-dev": {
1516
"behat/behat": "^3.6.1",
@@ -23,7 +24,6 @@
2324
"friends-of-behat/suite-settings-extension": "^1.0",
2425
"friends-of-behat/symfony-extension": "^2.1",
2526
"friends-of-behat/variadic-extension": "^1.3",
26-
"friendsofsymfony/oauth-server-bundle": "^1.6 || >2.0.0-alpha.0 ^2.0@dev",
2727
"lakion/mink-debug-extension": "^2.0.0",
2828
"lchrusciel/api-test-case": "^5.1",
2929
"matthiasnoback/symfony-dependency-injection-test": "^4.3",
@@ -35,13 +35,12 @@
3535
"phpstan/phpstan-symfony": "^1.0",
3636
"phpstan/phpstan-webmozart-assert": "^1.0",
3737
"phpunit/phpunit": "^9.5",
38-
"sensiolabs/security-checker": "^6.0",
3938
"sylius-labs/coding-standard": "^4.0",
40-
"symfony/browser-kit": "^4.4 || ^5.2",
41-
"symfony/debug-bundle": "^4.4 || ^5.2",
42-
"symfony/dotenv": "^4.4 || ^5.2",
43-
"symfony/intl": "^4.4 || ^5.2",
44-
"symfony/web-profiler-bundle": "^4.4 || ^5.2",
39+
"symfony/browser-kit": "^5.4 || ^6.0",
40+
"symfony/debug-bundle": "^5.4 || ^6.0",
41+
"symfony/dotenv": "^5.4 || ^6.0",
42+
"symfony/intl": "^5.4 || ^6.0",
43+
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
4544
"vimeo/psalm": "4.23.0"
4645
},
4746
"suggest": {

ecs.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
<?php
22

33
use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer;
4-
use PhpCsFixer\Fixer\FunctionNotation\NativeFunctionInvocationFixer;
5-
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6-
use Symplify\EasyCodingStandard\ValueObject\Option;
4+
use PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer;
5+
use Symplify\EasyCodingStandard\Config\ECSConfig;
76

8-
return static function (ContainerConfigurator $containerConfigurator): void {
9-
$containerConfigurator->import('vendor/sylius-labs/coding-standard/ecs.php');
7+
return static function (ECSConfig $config): void {
8+
$config->import('vendor/sylius-labs/coding-standard/ecs.php');
109

11-
$parameters = $containerConfigurator->parameters();
12-
$parameters->set(Option::SKIP, [
10+
$config->skip([
1311
VisibilityRequiredFixer::class => ['*Spec.php'],
1412
'tests/Application/*',
1513
]);
1614

17-
$services = $containerConfigurator->services();
18-
$services->set(
19-
NativeFunctionInvocationFixer::class
20-
)->call('configure', [['include' => ['@all'], 'scope' => 'all', 'strict' => \true]]);
15+
$config->ruleWithConfiguration(BinaryOperatorSpacesFixer::class, []);
2116
};

src/EventListener/AddRouteListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function __construct(GoogleTagManagerInterface $googleTagManager)
1818

1919
public function onKernelRequest(RequestEvent $event): void
2020
{
21-
if (!$event->isMasterRequest()) {
21+
if (!$event->isMainRequest()) {
2222
return;
2323
}
2424

src/EventListener/ContextListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function __construct(
2525
GoogleTagManagerInterface $googleTagManager,
2626
ChannelContextInterface $channelContext,
2727
LocaleContextInterface $localeContext,
28-
CurrencyContextInterface $currencyContext
28+
CurrencyContextInterface $currencyContext,
2929
) {
3030
$this->googleTagManager = $googleTagManager;
3131
$this->channelContext = $channelContext;
@@ -35,7 +35,7 @@ public function __construct(
3535

3636
public function onKernelRequest(RequestEvent $event): void
3737
{
38-
if (!$event->isMasterRequest()) {
38+
if (!$event->isMainRequest()) {
3939
return;
4040
}
4141

src/EventListener/EnvironmentListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function __construct(GoogleTagManagerInterface $googleTagManager, string
2121

2222
public function onKernelRequest(RequestEvent $event): void
2323
{
24-
if (!$event->isMasterRequest()) {
24+
if (!$event->isMainRequest()) {
2525
return;
2626
}
2727

tests/Application/Kernel.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Symfony\Component\DependencyInjection\ContainerBuilder;
1313
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
1414
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
15-
use Symfony\Component\Routing\RouteCollectionBuilder;
1615

1716
final class Kernel extends BaseKernel
1817
{
@@ -58,13 +57,6 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
5857
}
5958
}
6059

61-
protected function configureRoutes(RouteCollectionBuilder $routes): void
62-
{
63-
foreach ($this->getConfigurationDirectories() as $confDir) {
64-
$this->loadRoutesConfiguration($routes, $confDir);
65-
}
66-
}
67-
6860
protected function getContainerBaseClass(): string
6961
{
7062
if ($this->isTestEnvironment() && class_exists(MockerContainer::class)) {

tests/Application/config/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.');
1616
} else {
1717
// load all the .env files
18-
(new Dotenv(true))->loadEnv(dirname(__DIR__) . '/.env');
18+
(new Dotenv())->loadEnv(dirname(__DIR__) . '/.env');
1919
}
2020

2121
$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';

tests/Application/config/bundles.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
55
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
66
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
7-
Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class => ['all' => true],
87
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
98
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
109
Sylius\Bundle\OrderBundle\SyliusOrderBundle::class => ['all' => true],
@@ -56,4 +55,6 @@
5655
Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true],
5756
SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true],
5857
Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true],
58+
League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
59+
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
5960
];

tests/Application/config/packages/dev/swiftmailer.yaml

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)