Skip to content

Commit 0c6e7d9

Browse files
authored
Symfony 5.3 Framework Update (#14)
1 parent cd83604 commit 0c6e7d9

33 files changed

+2252
-1977
lines changed

.github/workflows/symfony.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313

1414
jobs:
1515
symfony:
16-
name: Symfony 5.2 (PHP ${{ matrix.php-versions }})
16+
name: Symfony 5.3 (PHP ${{ matrix.php-versions }})
1717
runs-on: ubuntu-latest
1818
strategy:
1919
fail-fast: true
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<?php
22

3-
$finder = PhpCsFixer\Finder::create()
3+
$finder = (new PhpCsFixer\Finder())
44
->in(__DIR__)
55
->exclude('var')
66
;
77

8-
return PhpCsFixer\Config::create()
8+
return (new PhpCsFixer\Config())
99
->setRules([
1010
'@Symfony' => true,
1111
'array_syntax' => ['syntax' => 'short'],
1212
])
1313
->setFinder($finder)
14+
->setCacheFile('.php-cs-fixer.cache')
1415
;

bin/console

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,15 @@
33

44
use App\Kernel;
55
use Symfony\Bundle\FrameworkBundle\Console\Application;
6-
use Symfony\Component\Console\Input\ArgvInput;
7-
use Symfony\Component\Dotenv\Dotenv;
8-
use Symfony\Component\ErrorHandler\Debug;
96

10-
if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
11-
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL;
7+
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
8+
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
129
}
1310

14-
set_time_limit(0);
11+
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
1512

16-
require dirname(__DIR__).'/vendor/autoload.php';
13+
return function (array $context) {
14+
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
1715

18-
if (!class_exists(Application::class) || !class_exists(Dotenv::class)) {
19-
throw new LogicException('You need to add "symfony/framework-bundle" and "symfony/dotenv" as Composer dependencies.');
20-
}
21-
22-
$input = new ArgvInput();
23-
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
24-
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
25-
}
26-
27-
if ($input->hasParameterOption('--no-debug', true)) {
28-
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
29-
}
30-
31-
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
32-
33-
if ($_SERVER['APP_DEBUG']) {
34-
umask(0000);
35-
36-
if (class_exists(Debug::class)) {
37-
Debug::enable();
38-
}
39-
}
40-
41-
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
42-
$application = new Application($kernel);
43-
$application->run($input);
16+
return new Application($kernel);
17+
};

composer.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,40 @@
1313
"php": ">=7.3.0",
1414
"ext-ctype": "*",
1515
"ext-iconv": "*",
16-
"doctrine/doctrine-bundle": "^2.2",
17-
"sensio/framework-extra-bundle": "^6.0",
16+
"doctrine/doctrine-bundle": "^2.3",
17+
"sensio/framework-extra-bundle": "^6.1",
1818
"symfony/apache-pack": "^1.0",
19-
"symfony/console": "5.2.*",
20-
"symfony/dotenv": "5.2.*",
21-
"symfony/flex": "^1.12",
22-
"symfony/form": "5.2.*",
23-
"symfony/framework-bundle": "5.2.*",
24-
"symfony/mailer": "5.2.*",
25-
"symfony/monolog-bundle": "^3.6",
26-
"symfony/security-bundle": "5.2.*",
27-
"symfony/translation": "5.2.*",
28-
"symfony/validator": "5.2.*",
29-
"symfony/yaml": "5.2.*"
19+
"symfony/console": "5.3.*",
20+
"symfony/dotenv": "5.3.*",
21+
"symfony/flex": "^1.13",
22+
"symfony/form": "5.3.*",
23+
"symfony/framework-bundle": "5.3.*",
24+
"symfony/mailer": "5.3.*",
25+
"symfony/monolog-bundle": "^3.7",
26+
"symfony/runtime": "5.3.*",
27+
"symfony/security-bundle": "5.3.*",
28+
"symfony/translation": "5.3.*",
29+
"symfony/validator": "5.3.*",
30+
"symfony/yaml": "5.3.*"
3031
},
3132
"require-dev": {
3233
"codeception/codeception": "^4.1",
3334
"codeception/module-asserts": "^1.3",
3435
"codeception/module-doctrine2": "^1.1",
3536
"codeception/module-phpbrowser": "^1.0",
36-
"codeception/module-symfony": "^1.5 | *@dev",
37+
"codeception/module-symfony": "^2.0 | *@dev",
3738
"doctrine/doctrine-fixtures-bundle": "^3.4",
38-
"friendsofphp/php-cs-fixer": "^2.18",
39-
"phpmd/phpmd": "^2.9",
40-
"rector/rector": "^0.9.18",
39+
"friendsofphp/php-cs-fixer": "^2.19",
40+
"phpmd/phpmd": "^2.10",
41+
"rector/rector": "^0.10",
4142
"roave/security-advisories": "dev-latest",
42-
"squizlabs/php_codesniffer": "^3.5",
43-
"symfony/debug-bundle": "5.2.*",
44-
"symfony/maker-bundle": "^1.28",
45-
"symfony/twig-bundle": "5.2.*",
46-
"symfony/var-dumper": "5.2.*",
47-
"symfony/web-profiler-bundle": "5.2.*",
48-
"vimeo/psalm": "^4.4",
49-
"zenstruck/foundry": "^1.7"
43+
"squizlabs/php_codesniffer": "^3.6",
44+
"symfony/debug-bundle": "5.3.*",
45+
"symfony/maker-bundle": "^1.31",
46+
"symfony/twig-bundle": "5.3.*",
47+
"symfony/var-dumper": "5.3.*",
48+
"symfony/web-profiler-bundle": "5.3.*",
49+
"vimeo/psalm": "^4.7"
5050
},
5151
"config": {
5252
"optimize-autoloader": true,
@@ -110,7 +110,7 @@
110110
"extra": {
111111
"symfony": {
112112
"allow-contrib": false,
113-
"require": "5.2.*"
113+
"require": "5.3.*"
114114
}
115115
}
116116
}

0 commit comments

Comments
 (0)