Skip to content

Commit a81bb3f

Browse files
Merge pull request #1153 from csrdelft/php8-symfony6
PHP 8 & Symfony 6
2 parents b599a1d + 0d96417 commit a81bb3f

File tree

159 files changed

+2101
-2113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+2101
-2113
lines changed

.env.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ SYMFONY_DEPRECATIONS_HELPER=999999
55
PANTHER_WEB_SERVER_DIR=./htdocs/
66
# --force-prefers-reduced-motion om panther scrollen direct te maken.
77
PANTHER_CHROME_ARGUMENTS='--window-size=1400,1024 --force-prefers-reduced-motion'
8-
8+
PANTHER_ERROR_SCREENSHOT_DIR='./var/error-screenshots'
99
WIKI_URL=http://wiki.dev-csrdelft.nl

.github/workflows/ci.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ jobs:
6161
- name: 💤 Shutdown Ubuntu MySQL (SUDO)
6262
run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it
6363

64-
- uses: getong/mariadb-action@v1.1
64+
- uses: getong/mariadb-action@v1.11
6565
with:
66-
mariadb version: '10.3'
66+
mariadb version: '10.11'
6767
mysql root password: ''
6868

6969
- uses: actions/checkout@v3
@@ -89,7 +89,7 @@ jobs:
8989
- name: Setup PHP
9090
uses: shivammathur/setup-php@v2
9191
with:
92-
php-version: 8.2
92+
php-version: '8.2'
9393
tools: composer:v2
9494
extensions: pdo_mysql
9595

@@ -123,12 +123,12 @@ jobs:
123123
PANTHER_NO_SANDBOX: '1'
124124
run: php bin/phpunit
125125

126-
- name: 📤 Upload screenshot van fout
126+
- name: 📤 Upload cache + logs + screenshots bij fout
127127
if: ${{ failure() }}
128128
uses: actions/upload-artifact@v4
129129
with:
130-
name: screenshot
131-
path: screenshot
130+
name: debug
131+
path: var
132132

133133
deploy:
134134
name: Push naar productie
@@ -155,7 +155,7 @@ jobs:
155155
- name: Setup PHP
156156
uses: shivammathur/setup-php@v2
157157
with:
158-
php-version: 8.2
158+
php-version: '8.2'
159159
tools: composer:v2
160160
extensions: pdo_mysql
161161

@@ -213,7 +213,7 @@ jobs:
213213
- name: Setup PHP
214214
uses: shivammathur/setup-php@v2
215215
with:
216-
php-version: 8.2
216+
php-version: '8.2'
217217
tools: composer:v2
218218
extensions: pdo_mysql
219219

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ package-lock.json
102102
###< phpunit/phpunit ###
103103

104104
###> symfony/phpunit-bridge ###
105-
.phpunit
106105
.phpunit.result.cache
107106
/phpunit.xml
108107
###< symfony/phpunit-bridge ###

.idea/Projects.iml

+24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jsLibraryMappings.xml

-7
This file was deleted.

.idea/php-test-framework.xml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php.xml

+36-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.symfony.local.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
http:
2+
document_root: htdocs/
3+
passthru: index.php

bin/console

+10-36
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,22 @@
11
#!/usr/bin/env php
22
<?php
33

4-
use CsrDelft\common\ContainerFacade;
54
use CsrDelft\Kernel;
65
use Symfony\Bundle\FrameworkBundle\Console\Application;
7-
use Symfony\Component\Console\Input\ArgvInput;
8-
use Symfony\Component\ErrorHandler\Debug;
96

10-
if (false === 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_dir(dirname(__DIR__).'/vendor')) {
8+
throw new LogicException('Dependencies are missing. Try running "composer install".');
129
}
1310

14-
set_time_limit(0);
15-
16-
require dirname(__DIR__).'/vendor/autoload.php';
17-
18-
if (!class_exists(Application::class)) {
19-
throw new RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
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');
11+
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
12+
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
2913
}
3014

31-
require __DIR__ . '/../config/bootstrap.php';
32-
33-
$kernel = new Kernel($_SERVER['APP_ENV'], (bool)$_SERVER['APP_DEBUG']);
34-
$kernel->boot();
35-
$container = $kernel->getContainer();
36-
37-
ContainerFacade::init($container);
15+
require_once dirname(__DIR__).'/lib/defines.include.php';
16+
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
3817

39-
if ($_SERVER['APP_DEBUG']) {
40-
umask(0000);
41-
42-
if (class_exists(Debug::class)) {
43-
Debug::enable();
44-
}
45-
}
18+
return function (array $context) {
19+
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
4620

47-
$application = new Application($kernel);
48-
$application->run($input);
21+
return new Application($kernel);
22+
};

bin/phpunit

+17-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
#!/usr/bin/env php
22
<?php
33

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);
4+
if (!ini_get('date.timezone')) {
5+
ini_set('date.timezone', 'UTC');
76
}
87

9-
if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
10-
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
11-
}
8+
if (is_file(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit')) {
9+
if (PHP_VERSION_ID >= 80000) {
10+
require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit';
11+
} else {
12+
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
13+
require PHPUNIT_COMPOSER_INSTALL;
14+
PHPUnit\TextUI\Command::main();
15+
}
16+
} else {
17+
if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
18+
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
19+
exit(1);
20+
}
1221

13-
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
22+
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
23+
}

composer.json

+35-32
Original file line numberDiff line numberDiff line change
@@ -42,44 +42,46 @@
4242
"nelmio/cors-bundle": "^2.1",
4343
"parsecsv/php-parsecsv": "^1.2",
4444
"phpdocumentor/reflection-docblock": "^5.2",
45-
"sensio/framework-extra-bundle": "^6.2",
46-
"sentry/sentry-symfony": "^4.5",
47-
"symfony/cache": "5.4.*",
48-
"symfony/config": "5.4.*",
49-
"symfony/dotenv": "5.4.*",
45+
"sentry/sentry-symfony": "^4.14",
46+
"symfony/cache": "^6.0",
47+
"symfony/config": "^6.0",
48+
"symfony/dotenv": "^6.0",
5049
"symfony/flex": "^1.4",
51-
"symfony/form": "5.4.*",
52-
"symfony/framework-bundle": "5.4.*",
53-
"symfony/http-foundation": "5.4.*",
54-
"symfony/mime": "5.4.*",
50+
"symfony/form": "^6.0",
51+
"symfony/framework-bundle": "^6.0",
52+
"symfony/http-foundation": "^6.0",
53+
"symfony/mime": "^6.0",
5554
"symfony/monolog-bundle": "^3.5",
56-
"symfony/property-access": "5.4.*",
57-
"symfony/property-info": "5.4.*",
58-
"symfony/proxy-manager-bridge": "5.4.*",
59-
"symfony/routing": "5.4.*",
60-
"symfony/security-bundle": "5.4.*",
61-
"symfony/security-csrf": "5.4.*",
62-
"symfony/serializer": "5.4.*",
63-
"symfony/templating": "5.4.*",
64-
"symfony/translation": "5.4.*",
65-
"symfony/twig-bundle": "5.4.*",
66-
"symfony/uid": "5.4.*",
67-
"symfony/var-dumper": "5.4.*",
68-
"symfony/yaml": "5.4.*",
55+
"symfony/property-access": "^6.0",
56+
"symfony/property-info": "^6.0",
57+
"symfony/proxy-manager-bridge": "^6.0",
58+
"symfony/routing": "^6.0",
59+
"symfony/security-bundle": "^6.0",
60+
"symfony/security-csrf": "^6.0",
61+
"symfony/serializer": "^6.0",
62+
"symfony/templating": "^6.0",
63+
"symfony/translation": "^6.0",
64+
"symfony/twig-bundle": "^6.0",
65+
"symfony/uid": "^6.0",
66+
"symfony/var-dumper": "^6.0",
67+
"symfony/yaml": "^6.0",
6968
"tecnickcom/tcpdf": "^6.4",
7069
"twig/cssinliner-extra": "^3.3",
7170
"twig/extra-bundle": "^3.2",
7271
"twig/intl-extra": "^3.2",
7372
"twig/string-extra": "^3.5",
74-
"zumba/json-serializer": "^3.0"
73+
"zumba/json-serializer": "^3.0",
74+
"symfony/runtime": "^6.0",
75+
"symfony/console": "^6.0"
7576
},
7677
"config": {
7778
"platform": {
7879
"php": "8.2"
7980
},
8081
"allow-plugins": {
8182
"symfony/flex": true,
82-
"php-http/discovery": true
83+
"php-http/discovery": true,
84+
"symfony/runtime": true
8385
}
8486
},
8587
"autoload": {
@@ -91,21 +93,22 @@
9193
"include-path": ["lib/"],
9294
"require-dev": {
9395
"doctrine/doctrine-fixtures-bundle": "^3.3",
94-
"symfony/maker-bundle": "^1.19",
9596
"fakerphp/faker": "^1.23",
96-
"symfony/phpunit-bridge": "^7.1",
97-
"phpunit/phpunit": ">9",
98-
"spatie/phpunit-snapshot-assertions": "^4.0",
99-
"symfony/browser-kit": "^5.0",
100-
"symfony/css-selector": "^5.0",
97+
"symfony/maker-bundle": "^1.19",
98+
"symfony/phpunit-bridge": "^5.1",
99+
"phpunit/phpunit": "^10.0",
100+
"spatie/phpunit-snapshot-assertions": "^5.0",
101+
"symfony/browser-kit": "^6.0",
102+
"symfony/css-selector": "^6.0",
101103
"symfony/panther": "^2.0",
102104
"vimeo/psalm": "^5.0",
103105
"weirdan/doctrine-psalm-plugin": "2.9",
104106
"psalm/plugin-symfony": "5.2.5",
105107
"symfony/stopwatch": "^5.4",
106108
"symfony/web-profiler-bundle": "^5.4",
107109
"rector/rector": "^1.2",
108-
"dbrekelmans/bdi": "^1.3"
110+
"dbrekelmans/bdi": "^1.3",
111+
"psalm/plugin-phpunit": "^0.19.0"
109112
},
110113
"scripts": {
111114
"serve": [
@@ -116,7 +119,7 @@
116119
"generator": "@php bin/dev/generate.php",
117120
"flushcache": "@console stek:cache:flush",
118121
"analyze": "@php vendor/vimeo/psalm/psalm",
119-
"test": "@php vendor/phpunit/phpunit/phpunit --bootstrap ./phpunit.init.php tests",
122+
"test": "@php bin/phpunit",
120123
"console": "@php bin/console",
121124
"update-prod": [
122125
"@php -r \"exit(exec('git rev-parse --abbrev-ref HEAD') == 'master' ? 'Branch is master' . PHP_EOL : 1);\"",

0 commit comments

Comments
 (0)