Skip to content

Commit 6ed17f8

Browse files
committed
Revert "Merge pull request #1153 from csrdelft/php8-symfony6"
This reverts commit a81bb3f, reversing changes made to b599a1d.
1 parent f26873b commit 6ed17f8

File tree

158 files changed

+2102
-2090
lines changed

Some content is hidden

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

158 files changed

+2102
-2090
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-
PANTHER_ERROR_SCREENSHOT_DIR='./var/error-screenshots'
8+
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.11
64+
- uses: getong/mariadb-action@v1.1
6565
with:
66-
mariadb version: '10.11'
66+
mariadb version: '10.3'
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 cache + logs + screenshots bij fout
126+
- name: 📤 Upload screenshot van fout
127127
if: ${{ failure() }}
128128
uses: actions/upload-artifact@v4
129129
with:
130-
name: debug
131-
path: var
130+
name: screenshot
131+
path: screenshot
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,6 +102,7 @@ package-lock.json
102102
###< phpunit/phpunit ###
103103

104104
###> symfony/phpunit-bridge ###
105+
.phpunit
105106
.phpunit.result.cache
106107
/phpunit.xml
107108
###< 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
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.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

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

.symfony.local.yaml

-3
This file was deleted.

bin/console

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

4+
use CsrDelft\common\ContainerFacade;
45
use CsrDelft\Kernel;
56
use Symfony\Bundle\FrameworkBundle\Console\Application;
7+
use Symfony\Component\Console\Input\ArgvInput;
8+
use Symfony\Component\ErrorHandler\Debug;
69

7-
if (!is_dir(dirname(__DIR__).'/vendor')) {
8-
throw new LogicException('Dependencies are missing. Try running "composer install".');
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;
912
}
1013

11-
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
12-
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
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');
1329
}
1430

15-
require_once dirname(__DIR__).'/lib/defines.include.php';
16-
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
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);
1738

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

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

bin/phpunit

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

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

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-
}
21-
22-
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
9+
if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
10+
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
2311
}
12+
13+
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';

composer.json

+32-35
Original file line numberDiff line numberDiff line change
@@ -42,46 +42,44 @@
4242
"nelmio/cors-bundle": "^2.1",
4343
"parsecsv/php-parsecsv": "^1.2",
4444
"phpdocumentor/reflection-docblock": "^5.2",
45-
"sentry/sentry-symfony": "^4.14",
46-
"symfony/cache": "^6.0",
47-
"symfony/config": "^6.0",
48-
"symfony/dotenv": "^6.0",
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.*",
4950
"symfony/flex": "^1.4",
50-
"symfony/form": "^6.0",
51-
"symfony/framework-bundle": "^6.0",
52-
"symfony/http-foundation": "^6.0",
53-
"symfony/mime": "^6.0",
51+
"symfony/form": "5.4.*",
52+
"symfony/framework-bundle": "5.4.*",
53+
"symfony/http-foundation": "5.4.*",
54+
"symfony/mime": "5.4.*",
5455
"symfony/monolog-bundle": "^3.5",
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",
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.*",
6869
"tecnickcom/tcpdf": "^6.4",
6970
"twig/cssinliner-extra": "^3.3",
7071
"twig/extra-bundle": "^3.2",
7172
"twig/intl-extra": "^3.2",
7273
"twig/string-extra": "^3.5",
73-
"zumba/json-serializer": "^3.0",
74-
"symfony/runtime": "^6.0",
75-
"symfony/console": "^6.0"
74+
"zumba/json-serializer": "^3.0"
7675
},
7776
"config": {
7877
"platform": {
7978
"php": "8.2"
8079
},
8180
"allow-plugins": {
8281
"symfony/flex": true,
83-
"php-http/discovery": true,
84-
"symfony/runtime": true
82+
"php-http/discovery": true
8583
}
8684
},
8785
"autoload": {
@@ -93,22 +91,21 @@
9391
"include-path": ["lib/"],
9492
"require-dev": {
9593
"doctrine/doctrine-fixtures-bundle": "^3.3",
96-
"fakerphp/faker": "^1.23",
9794
"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",
95+
"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",
103101
"symfony/panther": "^2.0",
104102
"vimeo/psalm": "^5.0",
105103
"weirdan/doctrine-psalm-plugin": "2.9",
106104
"psalm/plugin-symfony": "5.2.5",
107105
"symfony/stopwatch": "^5.4",
108106
"symfony/web-profiler-bundle": "^5.4",
109107
"rector/rector": "^1.2",
110-
"dbrekelmans/bdi": "^1.3",
111-
"psalm/plugin-phpunit": "^0.19.0"
108+
"dbrekelmans/bdi": "^1.3"
112109
},
113110
"scripts": {
114111
"serve": [
@@ -119,7 +116,7 @@
119116
"generator": "@php bin/dev/generate.php",
120117
"flushcache": "@console stek:cache:flush",
121118
"analyze": "@php vendor/vimeo/psalm/psalm",
122-
"test": "@php bin/phpunit",
119+
"test": "@php vendor/phpunit/phpunit/phpunit --bootstrap ./phpunit.init.php tests",
123120
"console": "@php bin/console",
124121
"update-prod": [
125122
"@php -r \"exit(exec('git rev-parse --abbrev-ref HEAD') == 'master' ? 'Branch is master' . PHP_EOL : 1);\"",

0 commit comments

Comments
 (0)