Skip to content

Commit 59d201c

Browse files
author
Robin Chalas
committed
Add scalar typehints/return types on final/internal/private code
1 parent 033f935 commit 59d201c

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

Translator.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,7 @@ protected function initializeCatalogue($locale)
280280
$this->loadFallbackCatalogues($locale);
281281
}
282282

283-
/**
284-
* @param string $locale
285-
*/
286-
private function initializeCacheCatalogue($locale)
283+
private function initializeCacheCatalogue(string $locale): void
287284
{
288285
if (isset($this->catalogues[$locale])) {
289286
/* Catalogue already initialized. */
@@ -306,7 +303,7 @@ function (ConfigCacheInterface $cache) use ($locale) {
306303
$this->catalogues[$locale] = include $cache->getPath();
307304
}
308305

309-
private function dumpCatalogue($locale, ConfigCacheInterface $cache)
306+
private function dumpCatalogue($locale, ConfigCacheInterface $cache): void
310307
{
311308
$this->initializeCatalogue($locale);
312309
$fallbackContent = $this->getFallbackContent($this->catalogues[$locale]);
@@ -331,7 +328,7 @@ private function dumpCatalogue($locale, ConfigCacheInterface $cache)
331328
$cache->write($content, $this->catalogues[$locale]->getResources());
332329
}
333330

334-
private function getFallbackContent(MessageCatalogue $catalogue)
331+
private function getFallbackContent(MessageCatalogue $catalogue): string
335332
{
336333
$fallbackContent = '';
337334
$current = '';
@@ -366,7 +363,7 @@ private function getCatalogueCachePath($locale)
366363
return $this->cacheDir.'/catalogue.'.$locale.'.'.strtr(substr(base64_encode(hash('sha256', serialize($this->fallbackLocales), true)), 0, 7), '/', '_').'.php';
367364
}
368365

369-
private function doLoadCatalogue($locale)
366+
private function doLoadCatalogue($locale): void
370367
{
371368
$this->catalogues[$locale] = new MessageCatalogue($locale);
372369

@@ -380,7 +377,7 @@ private function doLoadCatalogue($locale)
380377
}
381378
}
382379

383-
private function loadFallbackCatalogues($locale)
380+
private function loadFallbackCatalogues($locale): void
384381
{
385382
$current = $this->catalogues[$locale];
386383

@@ -436,7 +433,7 @@ protected function assertValidLocale($locale)
436433
*
437434
* @return ConfigCacheFactoryInterface $configCacheFactory
438435
*/
439-
private function getConfigCacheFactory()
436+
private function getConfigCacheFactory(): ConfigCacheFactoryInterface
440437
{
441438
if (!$this->configCacheFactory) {
442439
$this->configCacheFactory = new ConfigCacheFactory($this->debug);

0 commit comments

Comments
 (0)