Skip to content

Commit fa54ebb

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 f02b701 + aa230f0 commit fa54ebb

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

CacheWarmer/AbstractPhpFileCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function warmUp(string $cacheDir)
4949
spl_autoload_register([ClassExistenceResource::class, 'throwOnRequiredClass']);
5050
try {
5151
if (!$this->doWarmUp($cacheDir, $arrayAdapter)) {
52-
return;
52+
return [];
5353
}
5454
} finally {
5555
spl_autoload_unregister([ClassExistenceResource::class, 'throwOnRequiredClass']);

Tests/CacheWarmer/RouterCacheWarmerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function testWarmUpWithWarmebleInterface()
2828
$routerCacheWarmer = new RouterCacheWarmer($containerMock);
2929

3030
$routerCacheWarmer->warmUp('/tmp');
31-
$routerMock->expects($this->any())->method('warmUp')->with('/tmp')->willReturn('');
31+
$routerMock->expects($this->any())->method('warmUp')->with('/tmp')->willReturn([]);
3232
$this->addToAssertionCount(1);
3333
}
3434

Translation/Translator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function warmUp(string $cacheDir)
100100
{
101101
// skip warmUp when translator doesn't use cache
102102
if (null === $this->options['cache_dir']) {
103-
return;
103+
return [];
104104
}
105105

106106
$localesToWarmUp = $this->enabledLocales ?: array_merge($this->getFallbackLocales(), [$this->getLocale()], $this->resourceLocales);

0 commit comments

Comments
 (0)