From c6e08c207c7c819b90622aeb9dd069cba1cff37a Mon Sep 17 00:00:00 2001 From: soyuka Date: Mon, 14 Oct 2024 11:42:58 +0200 Subject: [PATCH] fix(symfony): fetch api-platform/symfony version debug bar fixes #6709 --- .../Bundle/DataCollector/RequestDataCollector.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/DataCollector/RequestDataCollector.php b/src/Symfony/Bundle/DataCollector/RequestDataCollector.php index ddde1871a0..229bc7cc06 100644 --- a/src/Symfony/Bundle/DataCollector/RequestDataCollector.php +++ b/src/Symfony/Bundle/DataCollector/RequestDataCollector.php @@ -73,7 +73,16 @@ public function getVersion(): ?string return null; } - $version = Versions::getVersion('api-platform/core'); + try { + $version = Versions::getVersion('api-platform/symfony'); + } catch (\OutOfBoundsException $e) { + try { + $version = Versions::getVersion('api-platform/core'); + } catch (\OutOfBoundsException $e) { + return null; + } + } + preg_match('/^v(.*?)@/', (string) $version, $output); return $output[1] ?? strtok($version, '@');