Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use never return typehint #1654

Merged
merged 2 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/Monolog/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,7 @@ protected function defaultErrorLevelMap(): array
];
}

/**
* @phpstan-return never
*/
private function handleException(\Throwable $e): void
private function handleException(\Throwable $e): never
{
$level = LogLevel::ERROR;
foreach ($this->uncaughtExceptionLevelMap as $class => $candidate) {
Expand Down
4 changes: 1 addition & 3 deletions src/Monolog/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,8 @@ public static function pcreLastErrorMessage(int $code): string
* @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:
Expand Down