From 736383c7273cd95804c2a33cf2ee52d1ee2d1cd8 Mon Sep 17 00:00:00 2001 From: Damien ALEXANDRE Date: Thu, 27 Nov 2025 10:58:47 +0100 Subject: [PATCH 1/2] feat(symfony): Add support for Symfony 8 --- .github/workflows/test-package.yml | 2 ++ CHANGELOG.md | 6 ++++++ DependencyInjection/BugsnagExtension.php | 2 +- EventListener/BugsnagListener.php | 2 +- EventListener/BugsnagShutdown.php | 2 +- composer.json | 12 ++++++------ 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml index 0105e29..f054161 100644 --- a/.github/workflows/test-package.yml +++ b/.github/workflows/test-package.yml @@ -102,6 +102,8 @@ jobs: symfony-version: '^6.0' - php-version: '8.4' symfony-version: '^7.0' + - php-version: '8.4' + symfony-version: '^8.0' - php-version: '8.4' symfony-version: 'latest' diff --git a/CHANGELOG.md b/CHANGELOG.md index 6058f41..fbd0b0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ Changelog ========= +## Unreleased + +### Enhancements + +* Add support for Symfony 8 + ## v1.14.3 (2025-01-30) This release should ensure compatibility with PHP 8.4 by removing the usage of certain diff --git a/DependencyInjection/BugsnagExtension.php b/DependencyInjection/BugsnagExtension.php index 498d0c7..8818853 100644 --- a/DependencyInjection/BugsnagExtension.php +++ b/DependencyInjection/BugsnagExtension.php @@ -5,7 +5,7 @@ use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; +use Symfony\Component\DependencyInjection\Extension\Extension; class BugsnagExtension extends Extension { diff --git a/EventListener/BugsnagListener.php b/EventListener/BugsnagListener.php index 5731e01..20b6713 100644 --- a/EventListener/BugsnagListener.php +++ b/EventListener/BugsnagListener.php @@ -265,7 +265,7 @@ private function isMainRequest($requestType) /** * @return array */ - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { $listeners = [ KernelEvents::REQUEST => ['onKernelRequest', 256], diff --git a/EventListener/BugsnagShutdown.php b/EventListener/BugsnagShutdown.php index 6a61b61..1cc7660 100644 --- a/EventListener/BugsnagShutdown.php +++ b/EventListener/BugsnagShutdown.php @@ -32,7 +32,7 @@ class BugsnagShutdown implements EventSubscriberInterface, ShutdownStrategyInter * * @return array */ - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { $listeners = [ KernelEvents::TERMINATE => ['onTerminate', 10], diff --git a/composer.json b/composer.json index a091ca5..0056dd2 100644 --- a/composer.json +++ b/composer.json @@ -14,12 +14,12 @@ "require": { "php": ">=5.5", "bugsnag/bugsnag": "^3.29.0", - "symfony/config": "^2.7|^3|^4|^5|^6|^7", - "symfony/console": "^2.7|^3|^4|^5|^6|^7", - "symfony/dependency-injection": "^2.7|^3|^4|^5|^6|^7", - "symfony/http-foundation": "^2.7|^3|^4|^5|^6|^7", - "symfony/http-kernel": "^2.7|^3|^4|^5|^6|^7", - "symfony/security-core": "^2.7|^3|^4|^5|^6|^7" + "symfony/config": "^2.7|^3|^4|^5|^6|^7|^8", + "symfony/console": "^2.7|^3|^4|^5|^6|^7|^8", + "symfony/dependency-injection": "^2.7|^3|^4|^5|^6|^7|^8", + "symfony/http-foundation": "^2.7|^3|^4|^5|^6|^7|^8", + "symfony/http-kernel": "^2.7|^3|^4|^5|^6|^7|^8", + "symfony/security-core": "^2.7|^3|^4|^5|^6|^7|^8" }, "require-dev": { "graham-campbell/testbench-core": "^1.1", From 52b4c6ece9c063f147322257318dfbb074a0c05f Mon Sep 17 00:00:00 2001 From: Damien ALEXANDRE Date: Thu, 27 Nov 2025 15:24:48 +0100 Subject: [PATCH 2/2] fix PHP 8.4 compatibility --- DependencyInjection/BugsnagExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DependencyInjection/BugsnagExtension.php b/DependencyInjection/BugsnagExtension.php index 8818853..a500a3e 100644 --- a/DependencyInjection/BugsnagExtension.php +++ b/DependencyInjection/BugsnagExtension.php @@ -17,7 +17,7 @@ class BugsnagExtension extends Extension * * @return void */ - public function load(array $configs, ContainerBuilder $container) + public function load(array $configs, ContainerBuilder $container): void { $config = $this->processConfiguration(new Configuration(), $configs);