Skip to content

Commit 5b956a2

Browse files
committed
simplify the code
1 parent 9e645ac commit 5b956a2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

wcfsetup/install/files/lib/system/cache/eager/data/LanguageCacheData.class.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,19 @@ public function getLanguageCategory(string $categoryName): ?LanguageCategory
6161
public function getLanguageCategoryByID(int $languageCategoryID): ?LanguageCategory
6262
{
6363
$categoryName = $this->categoryIDs[$languageCategoryID] ?? null;
64+
if ($categoryName === null) {
65+
return null;
66+
}
6467

65-
return $this->categories[$categoryName] ?? null;
68+
return $this->getLanguageCategory($categoryName);
6669
}
6770

6871
/**
6972
* Returns `true` if the language category with the given category name exists.
7073
*/
7174
public function languageCategoryExists(string $categoryName): bool
7275
{
73-
return isset($this->categories[$categoryName]);
76+
return \array_key_exists($categoryName, $this->categories);
7477
}
7578

7679
/**

0 commit comments

Comments
 (0)