1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-04 04:07:39 +02:00

Use never return typehint (#1654)

The `never` return typehint was added in PHP 8.1 and can be used
to indicate that a function will never return.

RFC: https://wiki.php.net/rfc/noreturn_type
This commit is contained in:
Dan Hemberger
2022-04-19 12:50:32 -07:00
committed by GitHub
parent 2d006a8472
commit 14f39fe0ce
2 changed files with 2 additions and 7 deletions

View File

@@ -175,10 +175,7 @@ class ErrorHandler
];
}
/**
* @phpstan-return never
*/
private function handleException(\Throwable $e): void
private function handleException(\Throwable $e): never
{
$level = LogLevel::ERROR;
foreach ($this->uncaughtExceptionLevelMap as $class => $candidate) {

View File

@@ -165,10 +165,8 @@ final class Utils
* @param int $code return code of json_last_error function
* @param mixed $data data that was meant to be encoded
* @throws \RuntimeException
*
* @return never
*/
private static function throwEncodeError(int $code, $data): void
private static function throwEncodeError(int $code, $data): never
{
switch ($code) {
case JSON_ERROR_DEPTH: