diff --git a/phpstan-baseline.php b/phpstan-baseline.php index 4a614d93e7b2..a2cbffd050d0 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -4121,11 +4121,6 @@ 'count' => 1, 'path' => __DIR__ . '/system/Database/Seeder.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Debug/BaseExceptionHandler.php', -]; $ignoreErrors[] = [ 'message' => '#^Method CodeIgniter\\\\Debug\\\\BaseExceptionHandler\\:\\:collectVars\\(\\) return type has no value type specified in iterable type array\\.$#', 'count' => 1, diff --git a/system/Debug/BaseExceptionHandler.php b/system/Debug/BaseExceptionHandler.php index dbccdcd07790..4305265d2d2c 100644 --- a/system/Debug/BaseExceptionHandler.php +++ b/system/Debug/BaseExceptionHandler.php @@ -245,8 +245,14 @@ protected static function highlightFile(string $file, int $lineNumber, int $line */ protected function render(Throwable $exception, int $statusCode, $viewFile = null): void { - if (empty($viewFile) || ! is_file($viewFile)) { - echo 'The error view files were not found. Cannot render exception trace.'; + if ($viewFile === null) { + echo 'The error view file was not specified. Cannot display error view.'; + + exit(1); + } + + if (! is_file($viewFile)) { + echo 'The error view file "' . $viewFile . '" was not found. Cannot display error view.'; exit(1); }