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, '@');