Skip to content

Commit 341a432

Browse files
committed
minor #57775 [HttpFoundation][HttpKernel] Remove unused code and useless casts (alexandre-daubois)
This PR was merged into the 7.2 branch. Discussion ---------- [HttpFoundation][HttpKernel] Remove unused code and useless casts | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Removed some superfluous code and useless casts across HttpFoundation and HttpKernel Commits ------- c26bb3af75 [HttpFoundation][HttpKernel] Remove dead code and useless casts
2 parents 0643d07 + 3a8d803 commit 341a432

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

CacheWarmer/RouterCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function warmUp(string $cacheDir, ?string $buildDir = null): array
4343
$router = $this->container->get('router');
4444

4545
if ($router instanceof WarmableInterface) {
46-
return (array) $router->warmUp($cacheDir, $buildDir);
46+
return $router->warmUp($cacheDir, $buildDir);
4747
}
4848

4949
throw new \LogicException(\sprintf('The router "%s" cannot be warmed up because it does not implement "%s".', get_debug_type($router), WarmableInterface::class));

CacheWarmer/TranslationsCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function warmUp(string $cacheDir, ?string $buildDir = null): array
4040
$this->translator ??= $this->container->get('translator');
4141

4242
if ($this->translator instanceof WarmableInterface) {
43-
return (array) $this->translator->warmUp($cacheDir, $buildDir);
43+
return $this->translator->warmUp($cacheDir, $buildDir);
4444
}
4545

4646
return [];

Tests/CacheWarmer/RouterCacheWarmerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ public function testWarmUpWithWarmableInterfaceWithBuildDir()
2424
$container = new Container();
2525

2626
$routerMock = $this->getMockBuilder(testRouterInterfaceWithWarmableInterface::class)->onlyMethods(['match', 'generate', 'getContext', 'setContext', 'getRouteCollection', 'warmUp'])->getMock();
27+
$routerMock->method('warmUp')->willReturn([]);
28+
2729
$container->set('router', $routerMock);
2830
$routerCacheWarmer = new RouterCacheWarmer($container);
2931

0 commit comments

Comments
 (0)