diff options
author | Simon Rettberg | 2023-11-14 14:47:55 +0100 |
---|---|---|
committer | Simon Rettberg | 2023-11-14 14:47:55 +0100 |
commit | 06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0 (patch) | |
tree | 7e5493b102074672d8cfd8fe1a61e49f080edbe8 /inc/errorhandler.inc.php | |
parent | Update phpstorm config (diff) | |
download | slx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.tar.gz slx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.tar.xz slx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.zip |
Add function param/return types, fix a lot more phpstorm complaints
Diffstat (limited to 'inc/errorhandler.inc.php')
-rw-r--r-- | inc/errorhandler.inc.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/inc/errorhandler.inc.php b/inc/errorhandler.inc.php index c7a32b02..8e49353c 100644 --- a/inc/errorhandler.inc.php +++ b/inc/errorhandler.inc.php @@ -1,5 +1,7 @@ <?php +use JetBrains\PhpStorm\NoReturn; + class ErrorHandler { @@ -10,7 +12,8 @@ class ErrorHandler * and all globally defined variables. * (As this might reveal sensitive data you should never enable it in production) */ - public static function traceError($message) + #[NoReturn] + public static function traceError(string $message): void { if ((defined('API') && API) || (defined('AJAX') && AJAX) || php_sapi_name() === 'cli') { error_log('API ERROR: ' . $message); @@ -84,7 +87,7 @@ SADFACE; exit(0); } - public static function formatBacktraceHtml($trace): string + public static function formatBacktraceHtml(array $trace): string { $output = ''; foreach ($trace as $idx => $line) { @@ -104,7 +107,7 @@ SADFACE; return $output; } - public static function formatBacktracePlain($trace): string + public static function formatBacktracePlain(array $trace): string { $output = ''; foreach ($trace as $idx => $line) { @@ -121,7 +124,7 @@ SADFACE; return $output; } - private static function formatArgument($arg, $expandArray = true) + private static function formatArgument($arg, bool $expandArray = true): string { if (is_string($arg)) { $arg = "'$arg'"; |