Merge pull request #19491 from kamil-tekiela/ThemeManager-small-changes

ThemeManager small changes
This commit is contained in:
Maurício Meneghini Fauth 2025-01-02 17:39:42 -03:00 committed by GitHub
commit 47652b11f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 9 deletions

View File

@ -116,9 +116,6 @@ class ThemeManager
$this->activeTheme = $theme;
$this->theme = $this->themes[$theme];
// need to set later
//$this->setThemeCookie();
return true;
}
@ -230,7 +227,14 @@ class ThemeManager
return array_key_exists($theme ?? '', $this->themes);
}
/** @return mixed[] */
/** @return array{
* id: string,
* name: string,
* version: string,
* is_active: bool,
* color_mode: string,
* color_modes: array<string|int, string>
* }[] $themes */
public function getThemesArray(): array
{
$themes = [];

View File

@ -54,11 +54,6 @@ class ThemeManagerTest extends AbstractTestCase
$tm->initializeTheme();
$themes = $tm->getThemesArray();
self::assertArrayHasKey(0, $themes);
self::assertIsArray($themes[0]);
self::assertArrayHasKey('id', $themes[0]);
self::assertArrayHasKey('name', $themes[0]);
self::assertArrayHasKey('version', $themes[0]);
self::assertArrayHasKey('is_active', $themes[0]);
}
/**