psalm fixes

This commit is contained in:
Robin Appelman 2026-08-31 16:59:30 +02:00
commit bfbb443163

View file

@ -37,7 +37,7 @@ class Exception extends \Exception {
* @return Exception * @return Exception
*/ */
public static function fromMap(array $exceptionMap, $error, ?string $path): Exception { public static function fromMap(array $exceptionMap, $error, ?string $path): Exception {
if (isset($exceptionMap[$error])) { if ($error !== null && isset($exceptionMap[$error])) {
$exceptionClass = $exceptionMap[$error]; $exceptionClass = $exceptionMap[$error];
if (is_numeric($error)) { if (is_numeric($error)) {
return new $exceptionClass($path, (int)$error); return new $exceptionClass($path, (int)$error);