diff --git a/app/Config/Routing.php b/app/Config/Routing.php index e3183d2e8db8..8d3c773157cf 100644 --- a/app/Config/Routing.php +++ b/app/Config/Routing.php @@ -78,7 +78,7 @@ class Routing extends BaseRouting * Example: * public $override404 = 'App\Errors::show404'; */ - public $override404; + public ?string $override404 = null; /** * If TRUE, the system will attempt to match the URI against diff --git a/system/Config/Routing.php b/system/Config/Routing.php index 857a27769215..409bcf099f65 100644 --- a/system/Config/Routing.php +++ b/system/Config/Routing.php @@ -76,7 +76,7 @@ class Routing extends BaseConfig * Example: * public $override404 = 'App\Errors::show404'; */ - public $override404; + public ?string $override404 = null; /** * If TRUE, the system will attempt to match the URI against diff --git a/system/Debug/BaseExceptionHandler.php b/system/Debug/BaseExceptionHandler.php index 576149b8bf68..9afd450e8b48 100644 --- a/system/Debug/BaseExceptionHandler.php +++ b/system/Debug/BaseExceptionHandler.php @@ -89,7 +89,7 @@ protected function collectVars(Throwable $exception, int $statusCode): array * * @param array|object $trace */ - protected function maskSensitiveData(&$trace, array $keysToMask, string $path = '') + protected function maskSensitiveData(&$trace, array $keysToMask, string $path = ''): void { foreach ($keysToMask as $keyToMask) { $explode = explode('/', $keyToMask); diff --git a/system/Exceptions/FrameworkException.php b/system/Exceptions/FrameworkException.php index cee5f903e785..f268966cb6a2 100644 --- a/system/Exceptions/FrameworkException.php +++ b/system/Exceptions/FrameworkException.php @@ -33,6 +33,9 @@ public static function forInvalidFile(string $path) return new static(lang('Core.invalidFile', [$path])); } + /** + * @return static + */ public static function forInvalidDirectory(string $path) { return new static(lang('Core.invalidDirectory', [$path])); diff --git a/system/HTTP/SiteURI.php b/system/HTTP/SiteURI.php index e64080974940..adf873bfb902 100644 --- a/system/HTTP/SiteURI.php +++ b/system/HTTP/SiteURI.php @@ -328,7 +328,7 @@ public function refreshPath() /** * Saves our parts from a parse_url() call. */ - protected function applyParts(array $parts) + protected function applyParts(array $parts): void { if (! empty($parts['host'])) { $this->host = $parts['host']; diff --git a/system/HotReloader/HotReloader.php b/system/HotReloader/HotReloader.php index 2f10fae6a566..564ba544283a 100644 --- a/system/HotReloader/HotReloader.php +++ b/system/HotReloader/HotReloader.php @@ -16,7 +16,7 @@ */ final class HotReloader { - public function run() + public function run(): void { ini_set('zlib.output_compression', 'Off'); diff --git a/system/Router/AutoRouterImproved.php b/system/Router/AutoRouterImproved.php index a186fd33ef55..6e0583d2a1e9 100644 --- a/system/Router/AutoRouterImproved.php +++ b/system/Router/AutoRouterImproved.php @@ -121,7 +121,7 @@ public function __construct(// @phpstan-ignore-line $this->controller = $this->defaultController; } - private function createSegments(string $uri) + private function createSegments(string $uri): array { $segments = explode('/', $uri); $segments = array_filter($segments, static fn ($segment) => $segment !== '');