Skip to content

Commit d683172

Browse files
committedMar 22, 2021
Symfony versions configs
1 parent b079bb3 commit d683172

File tree

10 files changed

+56
-170
lines changed

10 files changed

+56
-170
lines changed
 

‎UPGRADE.md

-122
This file was deleted.

‎bin/create_node_symlink.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
exec(sprintf('mklink /J %s %s 2> NUL', NODE_MODULES_FOLDER_NAME, PATH_TO_NODE_MODULES), $output, $returnCode);
3030
$success = $returnCode === 0;
3131
if (!$success) {
32-
echo '> Failed o create the required symlink' . PHP_EOL;
32+
echo '> Failed o create the required symlink' . PHP_EOL;
3333
exit(2);
3434
}
3535
}

‎composer.json

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
22
"name": "sylius/modern-plugin-skeleton",
33
"type": "sylius-plugin",
4-
"keywords": ["sylius", "sylius-plugin"],
54
"description": "Acme example plugin for modern Sylius.",
5+
"keywords": [
6+
"sylius",
7+
"sylius-plugin"
8+
],
69
"license": "MIT",
710
"require": {
811
"php": "^7.3",
@@ -41,6 +44,14 @@
4144
"symfony/web-profiler-bundle": "^4.4 || ^5.2",
4245
"vimeo/psalm": "4.4.1"
4346
},
47+
"config": {
48+
"sort-packages": true
49+
},
50+
"extra": {
51+
"branch-alias": {
52+
"dev-master": "1.9-dev"
53+
}
54+
},
4455
"autoload": {
4556
"psr-4": {
4657
"Acme\\SyliusExamplePlugin\\": "src/"
@@ -52,14 +63,6 @@
5263
"Acme\\Tests\\SyliusExamplePlugin\\": "tests/"
5364
}
5465
},
55-
"extra": {
56-
"branch-alias": {
57-
"dev-master": "1.9-dev"
58-
}
59-
},
60-
"config": {
61-
"sort-packages": true
62-
},
6366
"scripts": {
6467
"post-install-cmd": [
6568
"php bin/create_node_symlink.php"

‎public/greeting.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
setTimeout(function () {
2-
document.getElementById('greeting').innerHTML = document.getElementById('greeting').dataset.greeting;
2+
document.getElementById('greeting').innerHTML = document.getElementById('greeting').dataset.greeting;
33
}, 1000);

‎tests/Application/.eslintrc.js

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
module.exports = {
2-
extends: 'airbnb-base',
3-
env: {
4-
node: true,
5-
},
6-
rules: {
7-
'object-shorthand': ['error', 'always', {
8-
avoidQuotes: true,
9-
avoidExplicitReturnArrows: true,
10-
}],
11-
'function-paren-newline': ['error', 'consistent'],
12-
'max-len': ['warn', 120, 2, {
13-
ignoreUrls: true,
14-
ignoreComments: false,
15-
ignoreRegExpLiterals: true,
16-
ignoreStrings: true,
17-
ignoreTemplateLiterals: true,
18-
}],
19-
},
2+
extends: 'airbnb-base',
3+
env: {
4+
node: true,
5+
},
6+
rules: {
7+
'object-shorthand': ['error', 'always', {
8+
avoidQuotes: true,
9+
avoidExplicitReturnArrows: true,
10+
}],
11+
'function-paren-newline': ['error', 'consistent'],
12+
'max-len': ['warn', 120, 2, {
13+
ignoreUrls: true,
14+
ignoreComments: false,
15+
ignoreRegExpLiterals: true,
16+
ignoreStrings: true,
17+
ignoreTemplateLiterals: true,
18+
}],
19+
},
2020
};

‎tests/Application/Kernel.php

+18-15
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,12 @@
77
use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer;
88
use Sylius\Bundle\CoreBundle\Application\Kernel as SyliusKernel;
99
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
10-
use Symfony\Component\Config\Loader\DelegatingLoader;
1110
use Symfony\Component\Config\Loader\LoaderInterface;
12-
use Symfony\Component\Config\Loader\LoaderResolver;
1311
use Symfony\Component\Config\Resource\FileResource;
1412
use Symfony\Component\DependencyInjection\ContainerBuilder;
15-
use Symfony\Component\DependencyInjection\ContainerInterface;
16-
use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
17-
use Symfony\Component\DependencyInjection\Loader\DirectoryLoader;
18-
use Symfony\Component\DependencyInjection\Loader\GlobFileLoader;
19-
use Symfony\Component\DependencyInjection\Loader\IniFileLoader;
20-
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
21-
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
22-
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
2313
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
24-
use Symfony\Component\HttpKernel\Config\FileLocator;
2514
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
2615
use Symfony\Component\Routing\RouteCollectionBuilder;
27-
use Webmozart\Assert\Assert;
2816

2917
final class Kernel extends BaseKernel
3018
{
@@ -45,14 +33,22 @@ public function getLogDir(): string
4533
public function registerBundles(): iterable
4634
{
4735
foreach ($this->getConfigurationDirectories() as $confDir) {
48-
yield from $this->registerBundlesFromFile($confDir . '/bundles.php');
36+
$bundlesFile = $confDir . '/bundles.php';
37+
if (false === is_file($bundlesFile)) {
38+
continue;
39+
}
40+
yield from $this->registerBundlesFromFile($bundlesFile);
4941
}
5042
}
5143

5244
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
5345
{
5446
foreach ($this->getConfigurationDirectories() as $confDir) {
55-
$container->addResource(new FileResource($confDir . '/bundles.php'));
47+
$bundlesFile = $confDir . '/bundles.php';
48+
if (false === is_file($bundlesFile)) {
49+
continue;
50+
}
51+
$container->addResource(new FileResource($bundlesFile));
5652
}
5753

5854
$container->setParameter('container.dumper.inline_class_loader', true);
@@ -117,6 +113,13 @@ private function registerBundlesFromFile(string $bundlesFile): iterable
117113
private function getConfigurationDirectories(): iterable
118114
{
119115
yield $this->getProjectDir() . '/config';
120-
yield $this->getProjectDir() . '/config/sylius/' . SyliusKernel::MAJOR_VERSION . '.' . SyliusKernel::MINOR_VERSION;
116+
$syliusConfigDir = $this->getProjectDir() . '/config/sylius/' . SyliusKernel::MAJOR_VERSION . '.' . SyliusKernel::MINOR_VERSION;
117+
if (is_dir($syliusConfigDir)) {
118+
yield $syliusConfigDir;
119+
}
120+
$symfonyConfigDir = $this->getProjectDir() . '/config/symfony/' . BaseKernel::MAJOR_VERSION . '.' . BaseKernel::MINOR_VERSION;
121+
if (is_dir($symfonyConfigDir)) {
122+
yield $symfonyConfigDir;
123+
}
121124
}
122125
}

‎tests/Application/composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "sylius/plugin-skeleton-test-application",
3-
"description": "Sylius application for plugin testing purposes (composer.json needed for project dir resolving)",
2+
"name": "sylius/modern-plugin-skeleton-test-application",
3+
"description": "Sylius application for modern plugin testing purposes (composer.json needed for project dir resolving)",
44
"license": "MIT"
55
}
-16 KB
Binary file not shown.

‎tests/Application/public/index.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Acme\Tests\SyliusExamplePlugin\Application\Kernel;
4-
use Symfony\Component\Debug\Debug;
6+
use Symfony\Component\ErrorHandler\Debug;
57
use Symfony\Component\HttpFoundation\Request;
68

7-
require dirname(__DIR__).'/config/bootstrap.php';
9+
require dirname(__DIR__) . '/config/bootstrap.php';
810

911
if ($_SERVER['APP_DEBUG']) {
1012
umask(0000);

0 commit comments

Comments
 (0)
Please sign in to comment.