Skip to content

Commit 8f10309

Browse files
authored
Merge pull request #29 from delyriand/feature/update_1.12
Update for sylius 1.12
2 parents 31695f7 + 4cd8581 commit 8f10309

File tree

9 files changed

+245
-422
lines changed

9 files changed

+245
-422
lines changed

.github/workflows/recipe.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,21 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
php: ['7.4', '8.0']
18-
sylius: ['~1.8.0', '~1.9.0', '~1.10.0', '~1.11.0']
17+
php: ['7.4', '8.0', '8.1']
18+
sylius: ['~1.8.0', '~1.9.0', '~1.10.0', '~1.11.0', '~1.12.0']
1919
exclude:
2020
- php: '8.0'
2121
sylius: '~1.8.0'
2222
- php: '8.0'
2323
sylius: '~1.9.0'
24+
- php: '8.1'
25+
sylius: '~1.8.0'
26+
- php: '8.1'
27+
sylius: '~1.9.0'
2428
- php: '7.4'
2529
sylius: '~1.11.0'
30+
- php: '7.4'
31+
sylius: '~1.12.0'
2632

2733
steps:
2834
- name: Setup PHP

.github/workflows/security.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
php: ['7.4', '8.0']
16+
php: ['7.4', '8.0', '8.1']
1717

1818
steps:
1919
- uses: actions/checkout@v3

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
php: ['8.0']
17+
php: ['8.0', '8.1']
1818

1919
env:
2020
SYMFONY_ARGS: --no-tls

.php-version.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.0
1+
8.1

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.DEFAULT_GOAL := help
22
SHELL=/bin/bash
33
APP_DIR=tests/Application
4-
SYLIUS_VERSION=1.11.0
4+
SYLIUS_VERSION=1.12.0
55
SYMFONY=cd ${APP_DIR} && symfony
66
COMPOSER=symfony composer
77
CONSOLE=${SYMFONY} console

composer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"description": "Disable the e-commerce on your Sylius.",
66
"license": "MIT",
77
"require": {
8-
"php": "~7.4|^8.0",
9-
"sylius/sylius": ">=1.8 <1.12",
8+
"php": "~7.4|~8.0|~8.1",
9+
"sylius/sylius": ">=1.8 <1.13",
1010
"monsieurbiz/sylius-settings-plugin": "^1.0.9"
1111
},
1212
"require-dev": {
@@ -71,5 +71,11 @@
7171
"flex://defaults"
7272
]
7373
}
74+
},
75+
"config": {
76+
"allow-plugins": {
77+
"php-http/discovery": true,
78+
"symfony/flex": true
79+
}
7480
}
7581
}

dist/src/Kernel.php

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -15,62 +15,15 @@
1515

1616
use MonsieurBiz\SyliusNoCommercePlugin\Kernel\SyliusNoCommerceKernelTrait;
1717
use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer;
18-
use Symfony\Component\Config\Loader\LoaderInterface;
19-
use Symfony\Component\Config\Resource\FileResource;
20-
use Symfony\Component\DependencyInjection\ContainerBuilder;
2118
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
22-
use Symfony\Component\Routing\RouteCollectionBuilder;
2319

2420
final class Kernel extends BaseKernel
2521
{
2622
use SyliusNoCommerceKernelTrait;
2723

28-
private const CONFIG_EXTS = '.{php,xml,yaml,yml}';
29-
30-
public function getCacheDir(): string
31-
{
32-
return $this->getProjectDir() . '/var/cache/' . $this->environment;
33-
}
34-
35-
public function getLogDir(): string
36-
{
37-
return $this->getProjectDir() . '/var/log';
38-
}
39-
40-
public function registerBundles(): iterable
41-
{
42-
$contents = require $this->getProjectDir() . '/config/bundles.php';
43-
foreach ($contents as $class => $envs) {
44-
if (isset($envs['all']) || isset($envs[$this->environment])) {
45-
yield new $class();
46-
}
47-
}
48-
}
49-
50-
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
51-
{
52-
$container->addResource(new FileResource($this->getProjectDir() . '/config/bundles.php'));
53-
$container->setParameter('container.dumper.inline_class_loader', true);
54-
$confDir = $this->getProjectDir() . '/config';
55-
56-
$loader->load($confDir . '/{packages}/*' . self::CONFIG_EXTS, 'glob');
57-
$loader->load($confDir . '/{packages}/' . $this->environment . '/**/*' . self::CONFIG_EXTS, 'glob');
58-
$loader->load($confDir . '/{services}' . self::CONFIG_EXTS, 'glob');
59-
$loader->load($confDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob');
60-
}
61-
62-
protected function configureRoutes(RouteCollectionBuilder $routes): void
63-
{
64-
$confDir = $this->getProjectDir() . '/config';
65-
66-
$routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS, '/', 'glob');
67-
$routes->import($confDir . '/{routes}/' . $this->environment . '/**/*' . self::CONFIG_EXTS, '/', 'glob');
68-
$routes->import($confDir . '/{routes}' . self::CONFIG_EXTS, '/', 'glob');
69-
}
70-
7124
protected function getContainerBaseClass(): string
7225
{
73-
if ($this->isTestEnvironment()) {
26+
if (class_exists(MockerContainer::class) && $this->isTestEnvironment()) {
7427
return MockerContainer::class;
7528
}
7629

@@ -79,6 +32,6 @@ protected function getContainerBaseClass(): string
7932

8033
private function isTestEnvironment(): bool
8134
{
82-
return 0 === strpos($this->getEnvironment(), 'test');
35+
return str_starts_with($this->getEnvironment(), 'test');
8336
}
8437
}

0 commit comments

Comments
 (0)