[HttpKernel] backport FC compat code

This commit is contained in:
Nicolas Grekas 2019-11-06 15:42:08 +01:00
parent 4f04bedd00
commit 4c401ebdd6
3 changed files with 12 additions and 5 deletions

View File

@ -54,8 +54,10 @@ class DoctrineDataCollector extends DataCollector
/**
* {@inheritdoc}
*
* @param \Throwable|null $exception
*/
public function collect(Request $request, Response $response, \Exception $exception = null)
public function collect(Request $request, Response $response/*, \Throwable $exception = null*/)
{
$queries = [];
foreach ($this->loggers as $name => $logger) {
@ -119,7 +121,7 @@ class DoctrineDataCollector extends DataCollector
return 'db';
}
private function sanitizeQueries(string $connectionName, array $queries)
private function sanitizeQueries(string $connectionName, array $queries): array
{
foreach ($queries as $i => $query) {
$queries[$i] = $this->sanitizeQuery($connectionName, $query);
@ -128,7 +130,7 @@ class DoctrineDataCollector extends DataCollector
return $queries;
}
private function sanitizeQuery(string $connectionName, $query)
private function sanitizeQuery(string $connectionName, array $query): array
{
$query['explainable'] = true;
if (null === $query['params']) {

View File

@ -28,7 +28,7 @@
"symfony/config": "^4.2",
"symfony/dependency-injection": "~3.4|~4.0",
"symfony/form": "~4.3",
"symfony/http-kernel": "~3.4|~4.0",
"symfony/http-kernel": "^4.3.7|~4.0",
"symfony/messenger": "~4.3",
"symfony/property-access": "~3.4|~4.0",
"symfony/property-info": "~3.4|~4.0",
@ -48,6 +48,7 @@
"conflict": {
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
"symfony/dependency-injection": "<3.4",
"symfony/http-kernel": "<4.3.7",
"symfony/form": "<4.3",
"symfony/messenger": "<4.3"
},

View File

@ -138,10 +138,14 @@ class Profiler implements ResetInterface
/**
* Collects data for the given Response.
*
* @param \Throwable|null $exception
*
* @return Profile|null A Profile instance or null if the profiler is disabled
*/
public function collect(Request $request, Response $response, \Exception $exception = null)
public function collect(Request $request, Response $response/*, \Throwable $exception = null*/)
{
$exception = 2 < \func_num_args() ? func_get_arg(2) : null;
if (false === $this->enabled) {
return null;
}