From ea2b2ac9ee1382b1444393a42e676491d95f78e0 Mon Sep 17 00:00:00 2001 From: guandeng Date: Thu, 9 May 2024 10:34:39 +0800 Subject: [PATCH] Renamed `isinvalidStatus` to `isInvalidStatus` method name and added return type for gRPC (#6737) --- src/Parser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Parser.php b/src/Parser.php index d0a87da..a36eea8 100644 --- a/src/Parser.php +++ b/src/Parser.php @@ -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]; @@ -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; }