From f5b9a50a794b16284a970b20214f4ef78cb419ed 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 | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/DataCollector/RequestDataCollector.php b/src/Symfony/Bundle/DataCollector/RequestDataCollector.php index ddde1871a0e..0cc2a73f7e7 100644 --- a/src/Symfony/Bundle/DataCollector/RequestDataCollector.php +++ b/src/Symfony/Bundle/DataCollector/RequestDataCollector.php @@ -73,8 +73,17 @@ public function getVersion(): ?string return null; } - $version = Versions::getVersion('api-platform/core'); - preg_match('/^v(.*?)@/', (string) $version, $output); + try { + $version = Versions::getVersion('api-platform/core'); + preg_match('/^v(.*?)@/', (string) $version, $output); + } catch (\OutOfBoundsException $e) { + try { + $version = Versions::getVersion('api-platform/symfony'); + preg_match('/^v(.*?)@/', (string) $version, $output); + } catch (\OutOfBoundsException $e) { + return null; + } + } return $output[1] ?? strtok($version, '@'); }