Use documented variable names in signature

This commit is contained in:
Sebastian Meyer 2023-12-19 16:02:05 +01:00
parent 2314e685a3
commit ba2ec7a516
2 changed files with 8 additions and 7 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
/.vscode/
/vendor/ /vendor/
.php-cs-fixer.php .php-cs-fixer.php
composer.lock composer.lock

View File

@ -37,19 +37,19 @@ class ThrowErrorException
/** /**
* Converts an internal PHP error into an ErrorException. * Converts an internal PHP error into an ErrorException.
* *
* @param int $severity The severity of the error * @param int $errno The severity of the error
* @param string $message The error message * @param string $errstr The error message
* @param ?string $file The name of the file the error was raised in * @param ?string $errfile The name of the file the error was raised in
* @param ?int $line The line number the error was raised in * @param ?int $errline The line number the error was raised in
* *
* @return bool Always returns FALSE when not throwing an exception * @return bool Always returns FALSE when not throwing an exception
* *
* @throws ErrorException * @throws ErrorException
*/ */
public function __invoke(int $severity = E_USER_ERROR, string $message = '', ?string $file = null, ?int $line = null): bool public function __invoke(int $errno = E_USER_ERROR, string $errstr = '', ?string $errfile = null, ?int $errline = null): bool
{ {
if ((error_reporting() & $severity) > 0) { if ((error_reporting() & $errno) > 0) {
throw new ErrorException($message, 0, $severity, $file, $line); throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
} }
return false; return false;
} }