diff --git a/src/Symfony/Bundle/DataCollector/RequestDataCollector.php b/src/Symfony/Bundle/DataCollector/RequestDataCollector.php index ddde1871a0..0cc2a73f7e 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, '@'); }