Skip to content

Commit

Permalink
fix(symfony): fetch api-platform/symfony version debug bar
Browse files Browse the repository at this point in the history
fixes #6709
  • Loading branch information
soyuka committed Oct 14, 2024
1 parent 99262dc commit f5b9a50
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Symfony/Bundle/DataCollector/RequestDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, '@');
}
Expand Down

0 comments on commit f5b9a50

Please sign in to comment.