mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-04 20:27:31 +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:
@@ -175,10 +175,7 @@ class ErrorHandler
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private function handleException(\Throwable $e): never
|
||||||
* @phpstan-return never
|
|
||||||
*/
|
|
||||||
private function handleException(\Throwable $e): void
|
|
||||||
{
|
{
|
||||||
$level = LogLevel::ERROR;
|
$level = LogLevel::ERROR;
|
||||||
foreach ($this->uncaughtExceptionLevelMap as $class => $candidate) {
|
foreach ($this->uncaughtExceptionLevelMap as $class => $candidate) {
|
||||||
|
@@ -165,10 +165,8 @@ final class Utils
|
|||||||
* @param int $code return code of json_last_error function
|
* @param int $code return code of json_last_error function
|
||||||
* @param mixed $data data that was meant to be encoded
|
* @param mixed $data data that was meant to be encoded
|
||||||
* @throws \RuntimeException
|
* @throws \RuntimeException
|
||||||
*
|
|
||||||
* @return never
|
|
||||||
*/
|
*/
|
||||||
private static function throwEncodeError(int $code, $data): void
|
private static function throwEncodeError(int $code, $data): never
|
||||||
{
|
{
|
||||||
switch ($code) {
|
switch ($code) {
|
||||||
case JSON_ERROR_DEPTH:
|
case JSON_ERROR_DEPTH:
|
||||||
|
Reference in New Issue
Block a user