From 5a16af011d03e5fa73939e0306c62f90eed9104b Mon Sep 17 00:00:00 2001 From: Jeroen Peters Date: Mon, 19 May 2025 20:32:39 +0200 Subject: [PATCH] PHP 8.4 notices: ThemeViewFinder.php Get rid of deprecated messages in PHP8.4, using explicit nullable type --- src/ThemeViewFinder.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/ThemeViewFinder.php b/src/ThemeViewFinder.php index 2344840..eb174a4 100644 --- a/src/ThemeViewFinder.php +++ b/src/ThemeViewFinder.php @@ -19,14 +19,10 @@ class ThemeViewFinder extends FileViewFinder public function getViewFinder() { - // It should return `theme.finder` if Laravel's view finder is replaced - // with package's finder. - // return app('theme.finder'); - return app('view')->getFinder(); } - public function setActiveTheme(string $theme, string $parentTheme = null): void + public function setActiveTheme(string $theme, ?string $parentTheme): void { if ($theme) { $this->clearThemes(); @@ -48,7 +44,7 @@ public function setHints($hints): void $this->hints = $hints; } - public function getThemePath(string $theme, string $path = null): string + public function getThemePath(string $theme, ?string $path): string { if (! config('theme.base_path')) { throw new ThemeBasePathNotDefined(); @@ -59,7 +55,7 @@ public function getThemePath(string $theme, string $path = null): string ); } - public function getThemeViewPath(string $theme = null): string + public function getThemeViewPath(?string $theme): string { $theme = $theme ?? $this->getActiveTheme(); @@ -109,8 +105,6 @@ public function clearThemes(): void public function registerTheme(string $theme): void { - // array_unshift($this->paths, $this->getThemeViewPath($theme)); - $this->getViewFinder()->prependLocation($this->getThemeViewPath($theme)); $this->registerNameSpacesForTheme($theme);