Skip to content

Commit 4832281

Browse files
authored
Merge pull request #7 from sirn-se/return-fix
Fix: Return switch null, not falsy
2 parents 4016d9f + 804e103 commit 4832281

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ErrorHandler.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function with(callable $callback, $handling = null, int $levels = E_ALL)
6363
} finally {
6464
$this->restore();
6565
}
66-
return $error ?: $result;
66+
return $error ?? $result;
6767
}
6868

6969
/**
@@ -85,9 +85,10 @@ public function withAll(callable $callback, $handling = null, int $levels = E_AL
8585
$result = $callback();
8686
$this->restore();
8787
$error = empty($errors) ? null : $this->handle($handling, $errors, $result);
88-
return $error ?: $result;
88+
return $error ?? $result;
8989
}
9090

91+
9192
/* ----------------- Private helpers --------------------------------------------- */
9293

9394
// Get handler function

0 commit comments

Comments
 (0)