Skip to content

Commit 0ae4c94

Browse files
minor #42490 More return type fixes (bis) (nicolas-grekas)
This PR was merged into the 5.4 branch. Discussion ---------- More return type fixes (bis) | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- c6a20b4e4d More return type fixes (bis)
2 parents 6a1fa09 + ac0f9c7 commit 0ae4c94

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

DataCollector/RequestDataCollector.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Symfony\Component\HttpKernel\Event\ControllerEvent;
2323
use Symfony\Component\HttpKernel\Event\ResponseEvent;
2424
use Symfony\Component\HttpKernel\KernelEvents;
25+
use Symfony\Component\VarDumper\Cloner\Data;
2526

2627
/**
2728
* @author Fabien Potencier <fabien@symfony.com>
@@ -343,8 +344,8 @@ public function getRouteParams()
343344
/**
344345
* Gets the parsed controller.
345346
*
346-
* @return array|string The controller as a string or array of data
347-
* with keys 'class', 'method', 'file' and 'line'
347+
* @return array|string|Data The controller as a string or array of data
348+
* with keys 'class', 'method', 'file' and 'line'
348349
*/
349350
public function getController()
350351
{
@@ -354,8 +355,8 @@ public function getController()
354355
/**
355356
* Gets the previous request attributes.
356357
*
357-
* @return array|bool A legacy array of data from the previous redirection response
358-
* or false otherwise
358+
* @return array|Data|false A legacy array of data from the previous redirection response
359+
* or false otherwise
359360
*/
360361
public function getRedirect()
361362
{

Profiler/Profile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function setParent(self $parent)
7474
/**
7575
* Returns the parent profile.
7676
*
77-
* @return self
77+
* @return self|null
7878
*/
7979
public function getParent()
8080
{

Tests/DataCollector/RequestDataCollectorTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Symfony\Component\HttpFoundation\Session\Session;
2323
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
2424
use Symfony\Component\HttpFoundation\Session\SessionInterface;
25+
use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
2526
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
2627
use Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface;
2728
use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
@@ -268,6 +269,8 @@ public function testItCollectsTheSessionTraceProperly()
268269
$session = $this->createMock(SessionInterface::class);
269270
$session->method('getMetadataBag')->willReturnCallback(static function () use ($collector) {
270271
$collector->collectSessionUsage();
272+
273+
return new MetadataBag();
271274
});
272275
$session->getMetadataBag();
273276

Tests/KernelTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ public function getNamespace(): string
522522
}
523523

524524
/**
525-
* @return false
525+
* @return string|false
526526
*/
527527
public function getXsdValidationBasePath()
528528
{

0 commit comments

Comments
 (0)