Skip to content

Commit f87bb9c

Browse files
committed
feat: upgrade to Symfony 5.1
1 parent a249e1d commit f87bb9c

20 files changed

Lines changed: 1587 additions & 867 deletions

api/.env.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# define your env variables for the test env here
2+
KERNEL_CLASS='App\Kernel'
3+
APP_SECRET='$ecretf0rt3st'
4+
SYMFONY_DEPRECATIONS_HELPER=999999
5+
PANTHER_APP_ENV=panther

api/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@
1616
/.php_cs
1717
/.php_cs.cache
1818
###< friendsofphp/php-cs-fixer ###
19+
20+
###> symfony/phpunit-bridge ###
21+
.phpunit
22+
.phpunit.result.cache
23+
/phpunit.xml
24+
###< symfony/phpunit-bridge ###

api/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
77
ARG PHP_VERSION=7.4
8-
ARG OPENRESTY_VERSION=1.15.8.3
8+
ARG OPENRESTY_VERSION=1.17.8.2
99
ARG VARNISH_VERSION=6.4
1010

1111

api/bin/console

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use App\Kernel;
55
use Symfony\Bundle\FrameworkBundle\Console\Application;
66
use Symfony\Component\Console\Input\ArgvInput;
7+
use Symfony\Component\Dotenv\Dotenv;
78
use Symfony\Component\ErrorHandler\Debug;
89

910
if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
@@ -14,8 +15,8 @@ set_time_limit(0);
1415

1516
require dirname(__DIR__).'/vendor/autoload.php';
1617

17-
if (!class_exists(Application::class)) {
18-
throw new LogicException('You need to add "symfony/framework-bundle" as a Composer dependency.');
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.');
1920
}
2021

2122
$input = new ArgvInput();
@@ -27,7 +28,7 @@ if ($input->hasParameterOption('--no-debug', true)) {
2728
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
2829
}
2930

30-
require dirname(__DIR__).'/config/bootstrap.php';
31+
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
3132

3233
if ($_SERVER['APP_DEBUG']) {
3334
umask(0000);

api/bin/phpunit

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
5+
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
6+
exit(1);
7+
}
8+
9+
if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
10+
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
11+
}
12+
13+
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';

api/composer.json

Lines changed: 55 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,52 @@
11
{
2+
"type": "project",
23
"license": "MIT",
34
"require": {
4-
"php": "^7.2.5",
5+
"php": ">=7.4",
56
"ext-ctype": "*",
67
"ext-iconv": "*",
7-
"api-platform/api-pack": "^1.1",
8-
"doctrine/doctrine-migrations-bundle": "^2.0",
9-
"guzzlehttp/guzzle": "^6.3",
10-
"symfony/console": "5.0.*",
11-
"symfony/dotenv": "5.0.*",
12-
"symfony/flex": "^1.1",
13-
"symfony/framework-bundle": "5.0.*",
14-
"symfony/mercure-bundle": "^0.2",
15-
"symfony/yaml": "5.0.*"
8+
"api-platform/core": "^2.5",
9+
"composer/package-versions-deprecated": "^1.11",
10+
"doctrine/annotations": "^1.0",
11+
"doctrine/doctrine-bundle": "^2.1",
12+
"doctrine/doctrine-migrations-bundle": "^3.0",
13+
"doctrine/orm": "^2.7",
14+
"guzzlehttp/guzzle": "^7.0",
15+
"nelmio/cors-bundle": "^2.1",
16+
"phpdocumentor/reflection-docblock": "^5.2",
17+
"symfony/asset": "5.1.*",
18+
"symfony/console": "5.1.*",
19+
"symfony/dotenv": "5.1.*",
20+
"symfony/expression-language": "5.1.*",
21+
"symfony/flex": "^1.3.1",
22+
"symfony/framework-bundle": "5.1.*",
23+
"symfony/mercure-bundle": "^0.2.5",
24+
"symfony/monolog-bundle": "^3.5",
25+
"symfony/property-access": "5.1.*",
26+
"symfony/property-info": "5.1.*",
27+
"symfony/security-bundle": "5.1.*",
28+
"symfony/serializer": "5.1.*",
29+
"symfony/twig-bundle": "5.1.*",
30+
"symfony/validator": "5.1.*",
31+
"symfony/yaml": "5.1.*"
1632
},
1733
"require-dev": {
18-
"api-platform/schema-generator": "^2.1",
19-
"symfony/maker-bundle": "^1.11",
20-
"symfony/profiler-pack": "^1.0"
34+
"api-platform/schema-generator": "^2.2",
35+
"symfony/browser-kit": "^5.1",
36+
"symfony/css-selector": "^5.1",
37+
"symfony/debug-bundle": "^5.1",
38+
"symfony/maker-bundle": "^1.21",
39+
"symfony/phpunit-bridge": "^5.1",
40+
"symfony/stopwatch": "^5.1",
41+
"symfony/var-dumper": "^5.1",
42+
"symfony/web-profiler-bundle": "^5.1"
2143
},
22-
"conflict": {
23-
"symfony/symfony": "*"
24-
},
25-
"replace": {
26-
"paragonie/random_compat": "2.*",
27-
"symfony/polyfill-ctype": "*",
28-
"symfony/polyfill-iconv": "*",
29-
"symfony/polyfill-php56": "*",
30-
"symfony/polyfill-php70": "*",
31-
"symfony/polyfill-php71": "*"
44+
"config": {
45+
"optimize-autoloader": true,
46+
"preferred-install": {
47+
"*": "dist"
48+
},
49+
"sort-packages": true
3250
},
3351
"autoload": {
3452
"psr-4": {
@@ -40,11 +58,16 @@
4058
"App\\Tests\\": "tests/"
4159
}
4260
},
43-
"config": {
44-
"preferred-install": {
45-
"*": "dist"
46-
},
47-
"sort-packages": true
61+
"replace": {
62+
"paragonie/random_compat": "2.*",
63+
"symfony/polyfill-ctype": "*",
64+
"symfony/polyfill-iconv": "*",
65+
"symfony/polyfill-php74": "*",
66+
"symfony/polyfill-php73": "*",
67+
"symfony/polyfill-php72": "*",
68+
"symfony/polyfill-php71": "*",
69+
"symfony/polyfill-php70": "*",
70+
"symfony/polyfill-php56": "*"
4871
},
4972
"scripts": {
5073
"auto-scripts": {
@@ -58,10 +81,13 @@
5881
"@auto-scripts"
5982
]
6083
},
84+
"conflict": {
85+
"symfony/symfony": "*"
86+
},
6187
"extra": {
6288
"symfony": {
6389
"allow-contrib": false,
64-
"require": "5.0.*"
90+
"require": "5.1.*"
6591
}
6692
}
6793
}

0 commit comments

Comments
 (0)