Skip to content

Commit

Permalink
Renamed isinvalidStatus to isInvalidStatus method name and added …
Browse files Browse the repository at this point in the history
…return type for gRPC (#6737)
  • Loading branch information
guandeng authored May 9, 2024
1 parent 7b0424c commit ea2b2ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static function parseResponse($response, $deserialize): array
if (! $response) {
return ['No response', self::GRPC_ERROR_NO_RESPONSE, $response];
}
if (self::isinvalidStatus($response->statusCode)) {
if (self::isInvalidStatus($response->statusCode)) {
$message = $response->headers['grpc-message'] ?? 'Http status Error';
$code = $response->headers['grpc-status'] ?? ($response->errCode ?: $response->statusCode);
return [$message, (int) $code, $response];
Expand Down Expand Up @@ -127,7 +127,7 @@ private static function serializeUnpackedMessage($data): string
return (string) $data;
}

private static function isinvalidStatus(int $code)
private static function isInvalidStatus(int $code): bool
{
return $code !== 0 && $code !== 200 && $code !== 400;
}
Expand Down

0 comments on commit ea2b2ac

Please sign in to comment.