From c4e62e6f34e979a766ace85959f4ea6561b9d422 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Fri, 13 Nov 2026 01:02:32 +0100 Subject: [PATCH] Allow Symfony 8 and make symfony/error-handler optional symfony/console was limited to 7.x, so applications using this package could not move to Symfony 8 components. The test suite and PHPStan pass unchanged with symfony/console 8.1 on PHP 8.4, so allow ^7.0 || ^8.0. symfony/error-handler was a hard dependency only for an instanceof check in Application::execute(), which is safe when the class is missing. Move it to require-dev and suggest. Also add prefer-stable next to minimum-stability dev, and let PHPStan analyse for PHP 8.3, the minimum version the package requires. Co-Authored-By: Claude Opus 5.5 --- composer.json | 10 ++++++---- docs/overview.md | 5 +++++ phpstan.neon | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 73378e2c..29459b94 100644 --- a/composer.json +++ b/composer.json @@ -10,19 +10,20 @@ "joomla/application": "^4.0", "joomla/event": "^4.0", "joomla/string": "^4.0", - "symfony/console": "^v7.0.0", - "symfony/error-handler": "^7" + "symfony/console": "^7.0 || ^8.0" }, "require-dev": { "joomla/test": "^4.0", "phpunit/phpunit": "^12.5 || ^13.0", "psr/container": "^2.0", "squizlabs/php_codesniffer": "^4.0", + "symfony/error-handler": "^7.0 || ^8.0", "phpstan/phpstan": "^2.1.17", "phpstan/phpstan-deprecation-rules": "^2.0.3" }, "suggest": { - "psr/container-implementation": "To use the ContainerLoader" + "psr/container-implementation": "To use the ContainerLoader", + "symfony/error-handler": "To route uncaught exceptions to the application when the Symfony ErrorHandler is registered" }, "autoload": { "psr-4": { @@ -34,5 +35,6 @@ "Joomla\\Console\\Tests\\": "tests/" } }, - "minimum-stability": "dev" + "minimum-stability": "dev", + "prefer-stable": true } diff --git a/docs/overview.md b/docs/overview.md index 59eeb9f2..3a74d3e1 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -9,6 +9,11 @@ excellent infrastructure however its two main pieces, the base Application class the Joomla code structure and methodology. Therefore, this package provides a replacement for these core classes and aims to be able to use the Symfony component API as practical. +Since 4.1 the package works with Symfony Console 7 and 8 (Symfony 8 needs PHP 8.4). `symfony/error-handler` is no +longer installed with it: the application only checks whether Symfony's `ErrorHandler` is the registered exception +handler and, if so, routes uncaught exceptions to its own rendering through it. Require `symfony/error-handler` in your +project if you use it. + ### Console Application Unlike the Application's `AbstractCliApplication` class, this package provides a fully functional and somewhat opinionated `Application` class diff --git a/phpstan.neon b/phpstan.neon index 07d82270..13fa968d 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -4,7 +4,7 @@ includes: parameters: level: 5 - phpVersion: 80100 + phpVersion: 80300 reportUnmatchedIgnoredErrors: false paths: - src