Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8 & Symfony 6 #1153

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_WEB_SERVER_DIR=./htdocs/
# --force-prefers-reduced-motion om panther scrollen direct te maken.
PANTHER_CHROME_ARGUMENTS='--window-size=1400,1024 --force-prefers-reduced-motion'

PANTHER_ERROR_SCREENSHOT_DIR='./var/error-screenshots'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waarom werkt dit niet...

WIKI_URL=http://wiki.dev-csrdelft.nl
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ jobs:
- name: 💤 Shutdown Ubuntu MySQL (SUDO)
run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it

- uses: getong/mariadb-action@v1.1
- uses: getong/mariadb-action@v1.11
with:
mariadb version: '10.3'
mariadb version: '10.11'
mysql root password: ''

- uses: actions/checkout@v3
Expand All @@ -80,7 +80,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: '8.2'
tools: composer:v2
extensions: pdo_mysql

Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: '8.2'
tools: composer:v2
extensions: pdo_mysql

Expand Down Expand Up @@ -204,7 +204,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: '8.2'
tools: composer:v2
extensions: pdo_mysql

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ package-lock.json
###< phpunit/phpunit ###

###> symfony/phpunit-bridge ###
.phpunit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

klopt dit wel?

.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###
Expand Down
2 changes: 1 addition & 1 deletion .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .symfony.local.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
http:
document_root: htdocs/
passthru: index.php
46 changes: 10 additions & 36 deletions bin/console
Original file line number Diff line number Diff line change
@@ -1,48 +1,22 @@
#!/usr/bin/env php
<?php

use CsrDelft\common\ContainerFacade;
use CsrDelft\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\ErrorHandler\Debug;

if (false === in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.\PHP_SAPI.' SAPI'.\PHP_EOL;
if (!is_dir(dirname(__DIR__).'/vendor')) {
throw new LogicException('Dependencies are missing. Try running "composer install".');
}

set_time_limit(0);

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

if (!class_exists(Application::class)) {
throw new RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
}

$input = new ArgvInput();
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
}

if ($input->hasParameterOption('--no-debug', true)) {
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
}

require __DIR__ . '/../config/bootstrap.php';

$kernel = new Kernel($_SERVER['APP_ENV'], (bool)$_SERVER['APP_DEBUG']);
$kernel->boot();
$container = $kernel->getContainer();

ContainerFacade::init($container);
require_once dirname(__DIR__).'/lib/defines.include.php';
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

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

if (class_exists(Debug::class)) {
Debug::enable();
}
}
return function (array $context) {
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);

$application = new Application($kernel);
$application->run($input);
return new Application($kernel);
};
24 changes: 17 additions & 7 deletions bin/phpunit
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
#!/usr/bin/env php
<?php

if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
if (!ini_get('date.timezone')) {
ini_set('date.timezone', 'UTC');
}

if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
}
if (is_file(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit')) {
if (PHP_VERSION_ID >= 80000) {
require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit';
} else {
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
require PHPUNIT_COMPOSER_INSTALL;
PHPUnit\TextUI\Command::main();
}
} else {
if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
}

require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
}
71 changes: 37 additions & 34 deletions composer.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dependencies moeten naar 6.4 voor upgraden naar Symfony 7

Original file line number Diff line number Diff line change
Expand Up @@ -42,44 +42,46 @@
"nelmio/cors-bundle": "^2.1",
"parsecsv/php-parsecsv": "^1.2",
"phpdocumentor/reflection-docblock": "^5.2",
"sensio/framework-extra-bundle": "^6.2",
"sentry/sentry-symfony": "^4.5",
"symfony/cache": "5.4.*",
"symfony/config": "5.4.*",
"symfony/dotenv": "5.4.*",
"sentry/sentry-symfony": "^4.14",
"symfony/cache": "^6.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6.4?

"symfony/config": "^6.0",
"symfony/dotenv": "^6.0",
"symfony/flex": "^1.4",
"symfony/form": "5.4.*",
"symfony/framework-bundle": "5.4.*",
"symfony/http-foundation": "5.4.*",
"symfony/mime": "5.4.*",
"symfony/form": "^6.0",
"symfony/framework-bundle": "^6.0",
"symfony/http-foundation": "^6.0",
"symfony/mime": "^6.0",
"symfony/monolog-bundle": "^3.5",
"symfony/property-access": "5.4.*",
"symfony/property-info": "5.4.*",
"symfony/proxy-manager-bridge": "5.4.*",
"symfony/routing": "5.4.*",
"symfony/security-bundle": "5.4.*",
"symfony/security-csrf": "5.4.*",
"symfony/serializer": "5.4.*",
"symfony/templating": "5.4.*",
"symfony/translation": "5.4.*",
"symfony/twig-bundle": "5.4.*",
"symfony/uid": "5.4.*",
"symfony/var-dumper": "5.4.*",
"symfony/yaml": "5.4.*",
"symfony/property-access": "^6.0",
"symfony/property-info": "^6.0",
"symfony/proxy-manager-bridge": "^6.0",
"symfony/routing": "^6.0",
"symfony/security-bundle": "^6.0",
"symfony/security-csrf": "^6.0",
"symfony/serializer": "^6.0",
"symfony/templating": "^6.0",
"symfony/translation": "^6.0",
"symfony/twig-bundle": "^6.0",
"symfony/uid": "^6.0",
"symfony/var-dumper": "^6.0",
"symfony/yaml": "^6.0",
"tecnickcom/tcpdf": "^6.4",
"twig/cssinliner-extra": "^3.3",
"twig/extra-bundle": "^3.2",
"twig/intl-extra": "^3.2",
"twig/string-extra": "^3.5",
"zumba/json-serializer": "^3.0"
"zumba/json-serializer": "^3.0",
"symfony/runtime": "^6.0",
"symfony/console": "^6.0"
},
"config": {
"platform": {
"php": "8.2"
},
"allow-plugins": {
"symfony/flex": true,
"php-http/discovery": true
"php-http/discovery": true,
"symfony/runtime": true
}
},
"autoload": {
Expand All @@ -91,21 +93,22 @@
"include-path": ["lib/"],
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.3",
"symfony/maker-bundle": "^1.19",
"fakerphp/faker": "^1.23",
"symfony/phpunit-bridge": "^7.1",
"phpunit/phpunit": ">9",
"spatie/phpunit-snapshot-assertions": "^4.0",
"symfony/browser-kit": "^5.0",
"symfony/css-selector": "^5.0",
"symfony/maker-bundle": "^1.19",
"symfony/phpunit-bridge": "^5.1",
"phpunit/phpunit": "^10.0",
"spatie/phpunit-snapshot-assertions": "^5.0",
"symfony/browser-kit": "^6.0",
"symfony/css-selector": "^6.0",
"symfony/panther": "^2.0",
"vimeo/psalm": "^4.7",
"weirdan/doctrine-psalm-plugin": "^1.0",
"psalm/plugin-symfony": "^2.2",
"vimeo/psalm": "^5.0",
"weirdan/doctrine-psalm-plugin": "^2.0",
"psalm/plugin-symfony": "^5.0",
"symfony/stopwatch": "^5.4",
"symfony/web-profiler-bundle": "^5.4",
"rector/rector": "^1.2",
"dbrekelmans/bdi": "^1.3"
"dbrekelmans/bdi": "^1.3",
"psalm/plugin-phpunit": "^0.19.0"
},
"scripts": {
"serve": [
Expand Down
Loading
Loading