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 16, 2024
1 parent 99262dc commit 54de22d
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,10 +73,19 @@ public function getVersion(): ?string
return null;
}

$version = Versions::getVersion('api-platform/core');
try {
$version = Versions::getVersion('api-platform/symfony');
} catch (\OutOfBoundsException) {
try {
$version = Versions::getVersion('api-platform/core');
} catch (\OutOfBoundsException) {
return null;
}
}

preg_match('/^v(.*?)@/', (string) $version, $output);

return $output[1] ?? strtok($version, '@');
return $output[1] ?? (strtok($version, '@') ?: null);
}

/**
Expand Down

0 comments on commit 54de22d

Please sign in to comment.