Skip to content

Commit 54de22d

Browse files
committed
fix(symfony): fetch api-platform/symfony version debug bar
fixes #6709
1 parent 99262dc commit 54de22d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/Symfony/Bundle/DataCollector/RequestDataCollector.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,19 @@ public function getVersion(): ?string
7373
return null;
7474
}
7575

76-
$version = Versions::getVersion('api-platform/core');
76+
try {
77+
$version = Versions::getVersion('api-platform/symfony');
78+
} catch (\OutOfBoundsException) {
79+
try {
80+
$version = Versions::getVersion('api-platform/core');
81+
} catch (\OutOfBoundsException) {
82+
return null;
83+
}
84+
}
85+
7786
preg_match('/^v(.*?)@/', (string) $version, $output);
7887

79-
return $output[1] ?? strtok($version, '@');
88+
return $output[1] ?? (strtok($version, '@') ?: null);
8089
}
8190

8291
/**

0 commit comments

Comments
 (0)