Skip to content

Commit

Permalink
Allow Symfony 7 (see #7279)
Browse files Browse the repository at this point in the history
Description
-----------

5.3 LTS requires Symfony 6.4 LTS as per our roadmap.

This means, Contao 5.4 must allow Symfony 7 components.

Dependencies:

- [x] `contao/manager-plugin`: contao/manager-plugin#56
- [x] `contao/image`: contao/image#104
- [x] `terminal42/service-annotation-bundle`: terminal42/service-annotation-bundle#9
- [x] `terminal42/escargot`: terminal42/escargot#36
- [x] Merge #7285 in `5.3`and then uptream into `5.x`

Commits
-------

0aa8323 Allow Symfony 7 in all packages
277005c Update to nikic/php-parser v5 in order to fix PHP incompatiblity issues
1eb7d8b Fixed test incompatibilities
a4eb15d Fixed DoctrineSchemaListener
a19c436 Fixed phpstan
af07922 Update calendar-bundle/composer.json
103d01e Update scheb/2fa bundles
01dca93 Fix interface incompatibility
15ebe55 Updated FOS HttpCache related dependencies
d18e73b Apply suggestions from code review
aef96c3 Fixed the LocaleSubscriberTest
5aef4aa Revert changes
ade8393 Cleanup
0c2b171 Use the existing news bundle when installing the core bundle in the "…

Co-authored-by: leofeyer <[email protected]>
  • Loading branch information
Toflar and leofeyer authored Jun 25, 2024
1 parent 88dc956 commit f7941e6
Show file tree
Hide file tree
Showing 23 changed files with 186 additions and 182 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,16 @@ jobs:
run: vendor-bin/depcheck/vendor/bin/composer-dependency-analyser --config=depcheck.php

- name: Install the core bundle
uses: ramsey/composer-install@v3
with:
working-directory: core-bundle
run: |
cd core-bundle
php -r '
$data = json_decode(file_get_contents(__DIR__."/composer.json"), true);
$data["repositories"][1]["type"] = "path";
$data["repositories"][1]["url"] = "../news-bundle";
file_put_contents(__DIR__."/composer.json", json_encode($data, JSON_UNESCAPED_SLASHES));
'
composer install --no-interaction --no-progress
cd ..
- name: Check for unknown symbols (contao/core-bundle)
run: vendor-bin/depcheck/vendor/bin/composer-dependency-analyser --config=depcheck.php --composer-json=core-bundle/composer.json
Expand Down
16 changes: 8 additions & 8 deletions calendar-bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@
"require": {
"php": "^8.1",
"contao/core-bundle": "self.version",
"friendsofsymfony/http-cache": "^2.4",
"symfony/config": "^6.4",
"symfony/dependency-injection": "^6.4",
"friendsofsymfony/http-cache": "^3.0",
"symfony/config": "^6.4 || ^7.0",
"symfony/dependency-injection": "^6.4 || ^7.0",
"symfony/deprecation-contracts": "^3.0",
"symfony/http-foundation": "^6.4",
"symfony/http-kernel": "^6.4",
"symfony/http-foundation": "^6.4 || ^7.0",
"symfony/http-kernel": "^6.4 || ^7.0",
"symfony/polyfill-mbstring": "^1.0",
"symfony/yaml": "^6.4"
"symfony/yaml": "^6.4 || ^7.0"
},
"require-dev": {
"contao/manager-plugin": "^2.3.1",
"contao/test-case": "self.version",
"phpunit/phpunit": "^9.5",
"symfony/http-client": "^6.4",
"symfony/phpunit-bridge": "^6.4"
"symfony/http-client": "^6.4 || ^7.0",
"symfony/phpunit-bridge": "^6.4 || ^7.0"
},
"conflict": {
"contao/core": "*",
Expand Down
6 changes: 3 additions & 3 deletions comments-bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
"require": {
"php": "^8.1",
"contao/core-bundle": "self.version",
"symfony/http-kernel": "^6.4"
"symfony/http-kernel": "^6.4 || ^7.0"
},
"require-dev": {
"contao/manager-plugin": "^2.3.1",
"contao/test-case": "self.version",
"phpunit/phpunit": "^9.5",
"symfony/http-client": "^6.4",
"symfony/phpunit-bridge": "^6.4"
"symfony/http-client": "^6.4 || ^7.0",
"symfony/phpunit-bridge": "^6.4 || ^7.0"
},
"conflict": {
"contao/core": "*",
Expand Down
104 changes: 52 additions & 52 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
"doctrine/orm": "^2.17",
"doctrine/persistence": "^3.2",
"dragonmantank/cron-expression": "^2.3",
"friendsofsymfony/http-cache": "^2.15.1",
"friendsofsymfony/http-cache-bundle": "^2.6",
"friendsofsymfony/http-cache": "^3.0",
"friendsofsymfony/http-cache-bundle": "^3.0",
"guzzlehttp/promises": "^1.5",
"imagine/imagine": "^1.2.4",
"knplabs/knp-menu": "^3.1",
Expand All @@ -85,7 +85,7 @@
"monolog/monolog": "^3.0",
"nelmio/cors-bundle": "^2.0.1",
"nelmio/security-bundle": "^3.0",
"nikic/php-parser": "^4.9",
"nikic/php-parser": "^5.0",
"nyholm/psr7": "^1.2",
"paragonie/constant_time_encoding": "^2.2",
"phpspec/php-diff": "^1.0",
Expand All @@ -94,70 +94,70 @@
"psr/container": "^2.0",
"psr/http-message": "^1.0 || ^2.0",
"psr/log": "^1.1 || 2.0 || ^3.0",
"scheb/2fa-backup-code": "^6.0",
"scheb/2fa-bundle": "^6.0",
"scheb/2fa-trusted-device": "^6.0",
"scheb/2fa-backup-code": "^6.0 || ^7.0",
"scheb/2fa-bundle": "^6.0 || ^7.0",
"scheb/2fa-trusted-device": "^6.0 || ^7.0",
"scrivo/highlight.php": "^9.18",
"scssphp/scssphp": "^1.5",
"simplepie/simplepie": "^1.3",
"spatie/schema-org": "^3.4",
"spomky-labs/otphp": "^10.0",
"symfony-cmf/routing": "^3.0",
"symfony-cmf/routing-bundle": "^3.0",
"symfony/asset": "^6.4",
"symfony/cache": "^6.4",
"symfony/asset": "^6.4 || ^7.0",
"symfony/cache": "^6.4 || ^7.0",
"symfony/cache-contracts": "^3.0",
"symfony/config": "^6.4",
"symfony/console": "^6.4",
"symfony/debug-bundle": "^6.4",
"symfony/dependency-injection": "^6.4",
"symfony/config": "^6.4 || ^7.0",
"symfony/console": "^6.4 || ^7.0",
"symfony/debug-bundle": "^6.4 || ^7.0",
"symfony/dependency-injection": "^6.4 || ^7.0",
"symfony/deprecation-contracts": "^3.0",
"symfony/doctrine-bridge": "^6.4",
"symfony/doctrine-messenger": "^6.4",
"symfony/dom-crawler": "^6.4",
"symfony/dotenv": "^6.4",
"symfony/error-handler": "^6.4",
"symfony/event-dispatcher": "^6.4",
"symfony/doctrine-bridge": "^6.4 || ^7.0",
"symfony/doctrine-messenger": "^6.4 || ^7.0",
"symfony/dom-crawler": "^6.4 || ^7.0",
"symfony/dotenv": "^6.4 || ^7.0",
"symfony/error-handler": "^6.4 || ^7.0",
"symfony/event-dispatcher": "^6.4 || ^7.0",
"symfony/event-dispatcher-contracts": "^3.0",
"symfony/expression-language": "^6.4",
"symfony/filesystem": "^6.4",
"symfony/finder": "^6.4",
"symfony/framework-bundle": "^6.4",
"symfony/html-sanitizer": "^6.4",
"symfony/http-client": "^6.4",
"symfony/expression-language": "^6.4 || ^7.0",
"symfony/filesystem": "^6.4 || ^7.0",
"symfony/finder": "^6.4 || ^7.0",
"symfony/framework-bundle": "^6.4 || ^7.0",
"symfony/html-sanitizer": "^6.4 || ^7.0",
"symfony/http-client": "^6.4 || ^7.0",
"symfony/http-client-contracts": "^3.1",
"symfony/http-foundation": "^6.4",
"symfony/http-kernel": "^6.4",
"symfony/intl": "^6.4",
"symfony/mailer": "^6.4",
"symfony/http-foundation": "^6.4 || ^7.0",
"symfony/http-kernel": "^6.4 || ^7.0",
"symfony/intl": "^6.4 || ^7.0",
"symfony/mailer": "^6.4 || ^7.0",
"symfony/maker-bundle": "^1.1",
"symfony/messenger": "^6.4",
"symfony/mime": "^6.4",
"symfony/monolog-bridge": "^6.4",
"symfony/messenger": "^6.4 || ^7.0",
"symfony/mime": "^6.4 || ^7.0",
"symfony/monolog-bridge": "^6.4 || ^7.0",
"symfony/monolog-bundle": "^3.1",
"symfony/options-resolver": "^6.4",
"symfony/password-hasher": "^6.4",
"symfony/options-resolver": "^6.4 || ^7.0",
"symfony/password-hasher": "^6.4 || ^7.0",
"symfony/polyfill-intl-idn": "^1.0",
"symfony/polyfill-mbstring": "^1.0",
"symfony/process": "^6.4",
"symfony/property-access": "^6.4",
"symfony/rate-limiter": "^6.4",
"symfony/routing": "^6.4",
"symfony/security-bundle": "^6.4",
"symfony/security-core": "^6.4",
"symfony/security-csrf": "^6.4",
"symfony/security-http": "^6.4",
"symfony/process": "^6.4 || ^7.0",
"symfony/property-access": "^6.4 || ^7.0",
"symfony/rate-limiter": "^6.4 || ^7.0",
"symfony/routing": "^6.4 || ^7.0",
"symfony/security-bundle": "^6.4 || ^7.0",
"symfony/security-core": "^6.4 || ^7.0",
"symfony/security-csrf": "^6.4 || ^7.0",
"symfony/security-http": "^6.4 || ^7.0",
"symfony/service-contracts": "^3.0",
"symfony/stopwatch": "^6.4",
"symfony/string": "^6.4",
"symfony/translation": "^6.4",
"symfony/stopwatch": "^6.4 || ^7.0",
"symfony/string": "^6.4 || ^7.0",
"symfony/translation": "^6.4 || ^7.0",
"symfony/translation-contracts": "^3.0",
"symfony/twig-bridge": "^6.4",
"symfony/twig-bundle": "^6.4",
"symfony/uid": "^6.4",
"symfony/var-dumper": "^6.4",
"symfony/web-profiler-bundle": "^6.4",
"symfony/yaml": "^6.4",
"symfony/twig-bridge": "^6.4 || ^7.0",
"symfony/twig-bundle": "^6.4 || ^7.0",
"symfony/uid": "^6.4 || ^7.0",
"symfony/var-dumper": "^6.4 || ^7.0",
"symfony/web-profiler-bundle": "^6.4 || ^7.0",
"symfony/yaml": "^6.4 || ^7.0",
"terminal42/escargot": "^1.6",
"terminal42/service-annotation-bundle": "^1.1",
"tijsverkoyen/css-to-inline-styles": "^2.0",
Expand All @@ -178,8 +178,8 @@
"league/flysystem-local": "^3.0",
"league/flysystem-memory": "^3.0",
"sebastian/diff": "^4.0",
"symfony/browser-kit": "^6.4",
"symfony/phpunit-bridge": "^6.4"
"symfony/browser-kit": "^6.4 || ^7.0",
"symfony/phpunit-bridge": "^6.4 || ^7.0"
},
"replace": {
"contao/calendar-bundle": "self.version",
Expand Down
94 changes: 47 additions & 47 deletions core-bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
"doctrine/persistence": "^3.2",
"dragonmantank/cron-expression": "^2.3",
"debril/feed-io": "^6.0",
"friendsofsymfony/http-cache": "^2.15.1",
"friendsofsymfony/http-cache-bundle": "^2.6",
"friendsofsymfony/http-cache": "^3.0",
"friendsofsymfony/http-cache-bundle": "^3.0",
"guzzlehttp/promises": "^1.5",
"imagine/imagine": "^1.2.4",
"knplabs/knp-menu": "^3.1",
Expand All @@ -84,69 +84,69 @@
"monolog/monolog": "^3.0",
"nelmio/cors-bundle": "^2.0.1",
"nelmio/security-bundle": "^3.0",
"nikic/php-parser": "^4.9",
"nikic/php-parser": "^5.0",
"nyholm/psr7": "^1.2",
"paragonie/constant_time_encoding": "^2.2",
"phpspec/php-diff": "^1.0",
"psr/cache": "^3.0",
"psr/container": "^2.0",
"psr/http-message": "^1.0 || ^2.0",
"psr/log": "^1.1 || 2.0 || ^3.0",
"scheb/2fa-backup-code": "^6.0",
"scheb/2fa-bundle": "^6.0",
"scheb/2fa-trusted-device": "^6.0",
"scheb/2fa-backup-code": "^6.0 || ^7.0",
"scheb/2fa-bundle": "^6.0 || ^7.0",
"scheb/2fa-trusted-device": "^6.0 || ^7.0",
"scrivo/highlight.php": "^9.18",
"scssphp/scssphp": "^1.5",
"simplepie/simplepie": "^1.3",
"spatie/schema-org": "^3.4",
"spomky-labs/otphp": "^10.0",
"symfony-cmf/routing": "^3.0",
"symfony-cmf/routing-bundle": "^3.0",
"symfony/asset": "^6.4",
"symfony/asset": "^6.4 || ^7.0",
"symfony/cache-contracts": "^3.0",
"symfony/config": "^6.4",
"symfony/console": "^6.4",
"symfony/dependency-injection": "^6.4",
"symfony/config": "^6.4 || ^7.0",
"symfony/console": "^6.4 || ^7.0",
"symfony/dependency-injection": "^6.4 || ^7.0",
"symfony/deprecation-contracts": "^3.0",
"symfony/doctrine-bridge": "^6.4",
"symfony/doctrine-messenger": "^6.4",
"symfony/dom-crawler": "^6.4",
"symfony/event-dispatcher": "^6.4",
"symfony/doctrine-bridge": "^6.4 || ^7.0",
"symfony/doctrine-messenger": "^6.4 || ^7.0",
"symfony/dom-crawler": "^6.4 || ^7.0",
"symfony/event-dispatcher": "^6.4 || ^7.0",
"symfony/event-dispatcher-contracts": "^3.0",
"symfony/expression-language": "^6.4",
"symfony/filesystem": "^6.4",
"symfony/finder": "^6.4",
"symfony/framework-bundle": "^6.4",
"symfony/html-sanitizer": "^6.4",
"symfony/http-client": "^6.4",
"symfony/expression-language": "^6.4 || ^7.0",
"symfony/filesystem": "^6.4 || ^7.0",
"symfony/finder": "^6.4 || ^7.0",
"symfony/framework-bundle": "^6.4 || ^7.0",
"symfony/html-sanitizer": "^6.4 || ^7.0",
"symfony/http-client": "^6.4 || ^7.0",
"symfony/http-client-contracts": "^3.1",
"symfony/http-foundation": "^6.4",
"symfony/http-kernel": "^6.4",
"symfony/intl": "^6.4",
"symfony/mailer": "^6.4",
"symfony/messenger": "^6.4",
"symfony/mime": "^6.4",
"symfony/monolog-bridge": "^6.4",
"symfony/password-hasher": "^6.4",
"symfony/http-foundation": "^6.4 || ^7.0",
"symfony/http-kernel": "^6.4 || ^7.0",
"symfony/intl": "^6.4 || ^7.0",
"symfony/mailer": "^6.4 || ^7.0",
"symfony/messenger": "^6.4 || ^7.0",
"symfony/mime": "^6.4 || ^7.0",
"symfony/monolog-bridge": "^6.4 || ^7.0",
"symfony/password-hasher": "^6.4 || ^7.0",
"symfony/polyfill-intl-idn": "^1.0",
"symfony/polyfill-mbstring": "^1.0",
"symfony/process": "^6.4",
"symfony/property-access": "^6.4",
"symfony/rate-limiter": "^6.4",
"symfony/routing": "^6.4",
"symfony/security-bundle": "^6.4",
"symfony/security-core": "^6.4",
"symfony/security-csrf": "^6.4",
"symfony/security-http": "^6.4",
"symfony/process": "^6.4 || ^7.0",
"symfony/property-access": "^6.4 || ^7.0",
"symfony/rate-limiter": "^6.4 || ^7.0",
"symfony/routing": "^6.4 || ^7.0",
"symfony/security-bundle": "^6.4 || ^7.0",
"symfony/security-core": "^6.4 || ^7.0",
"symfony/security-csrf": "^6.4 || ^7.0",
"symfony/security-http": "^6.4 || ^7.0",
"symfony/service-contracts": "^3.0",
"symfony/string": "^6.4",
"symfony/translation": "^6.4",
"symfony/string": "^6.4 || ^7.0",
"symfony/translation": "^6.4 || ^7.0",
"symfony/translation-contracts": "^3.0",
"symfony/twig-bridge": "^6.4",
"symfony/twig-bundle": "^6.4",
"symfony/uid": "^6.4",
"symfony/var-dumper": "^6.4",
"symfony/yaml": "^6.4",
"symfony/twig-bridge": "^6.4 || ^7.0",
"symfony/twig-bundle": "^6.4 || ^7.0",
"symfony/uid": "^6.4 || ^7.0",
"symfony/var-dumper": "^6.4 || ^7.0",
"symfony/yaml": "^6.4 || ^7.0",
"terminal42/escargot": "^1.6",
"terminal42/service-annotation-bundle": "^1.1",
"toflar/cronjob-supervisor": "^2.0",
Expand All @@ -166,11 +166,11 @@
"league/flysystem-memory": "^3.0",
"phpunit/phpunit": "^9.5.19",
"sebastian/diff": "^4.0",
"symfony/browser-kit": "^6.4",
"symfony/cache": "^6.4",
"symfony/browser-kit": "^6.4 || ^7.0",
"symfony/cache": "^6.4 || ^7.0",
"symfony/monolog-bundle": "^3.1",
"symfony/phpunit-bridge": "^6.4",
"symfony/web-profiler-bundle": "^6.4"
"symfony/phpunit-bridge": "^6.4 || ^7.0",
"symfony/web-profiler-bundle": "^6.4 || ^7.0"
},
"conflict": {
"contao-community-alliance/composer-plugin": "<3.0",
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/contao/library/Contao/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ public function __unserialize(array $data): void
/**
* {@inheritdoc}
*/
public function eraseCredentials()
public function eraseCredentials(): void
{
}

Expand Down
2 changes: 1 addition & 1 deletion core-bundle/src/Config/Loader/PhpFileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function supports(mixed $resource, string|null $type = null): bool
private function parseFile(string $file): array
{
$ast = (new ParserFactory())
->create(ParserFactory::PREFER_PHP7)
->createForHostVersion()
->parse(trim(file_get_contents($file)))
;

Expand Down
2 changes: 1 addition & 1 deletion core-bundle/src/Controller/BackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function pickerAction(Request $request): RedirectResponse
if ($request->query->has('extras')) {
$extras = $request->query->all('extras');

if (empty($extras)) {
if ([] === $extras) {
throw new BadRequestHttpException('Invalid picker extras');
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Exception\LogicException;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Path;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Toflar\CronjobSupervisor\Supervisor;

class ContaoCoreExtension extends Extension implements PrependExtensionInterface, ConfigureFilesystemInterface
Expand Down
Loading

0 comments on commit f7941e6

Please sign in to comment.