From 5f75c3a0f24fe7c0492e27ac361939985d951cb5 Mon Sep 17 00:00:00 2001 From: Shusaku Yusa Date: Tue, 25 Feb 2025 11:09:46 +0900 Subject: [PATCH 1/4] remove unused google/auth library --- .gitignore | 2 ++ composer.json | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..987e2a2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +composer.lock +vendor diff --git a/composer.json b/composer.json index 755ea4b..1857645 100644 --- a/composer.json +++ b/composer.json @@ -9,9 +9,6 @@ "require": { "php": ">=7.0.0" }, - "require-dev": { - "google/auth": "^v1.3.0" - }, "suggest": { "ext-protobuf": "For better performance, install the protobuf C extension.", "google/protobuf": "To get started using grpc quickly, install the native protobuf library." From b7e2b061ace204742ba38e50f1b48df4872a8ca9 Mon Sep 17 00:00:00 2001 From: Shusaku Yusa Date: Tue, 25 Feb 2025 11:10:33 +0900 Subject: [PATCH 2/4] fix typing of nullable parameters --- composer.json | 3 ++- src/lib/ServerCallWriter.php | 2 +- src/lib/Status.php | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 1857645..4abf716 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,8 @@ "license": "Apache-2.0", "version": "1.57.0", "require": { - "php": ">=7.0.0" + "php": ">=7.1.0", + "ext-grpc": "*" }, "suggest": { "ext-protobuf": "For better performance, install the protobuf C extension.", diff --git a/src/lib/ServerCallWriter.php b/src/lib/ServerCallWriter.php index aceb20c..40fbe99 100644 --- a/src/lib/ServerCallWriter.php +++ b/src/lib/ServerCallWriter.php @@ -81,7 +81,7 @@ public function finish( private function addSendInitialMetadataOpIfNotSent( array &$batch, - array $initialMetadata = null + ?array $initialMetadata = null ) { if (!$this->initialMetadataSent_) { $batch[OP_SEND_INITIAL_METADATA] = $initialMetadata ?? []; diff --git a/src/lib/Status.php b/src/lib/Status.php index add208f..d47480f 100644 --- a/src/lib/Status.php +++ b/src/lib/Status.php @@ -32,7 +32,7 @@ */ class Status { - public static function status(int $code, string $details, array $metadata = null): array + public static function status(int $code, string $details, ?array $metadata = null): array { $status = [ 'code' => $code, @@ -44,7 +44,7 @@ public static function status(int $code, string $details, array $metadata = null return $status; } - public static function ok(array $metadata = null): array + public static function ok(?array $metadata = null): array { return Status::status(STATUS_OK, 'OK', $metadata); } From 65c9d6bafa06c81860007dc98fd3cf8510b782e5 Mon Sep 17 00:00:00 2001 From: Shusaku Yusa Date: Wed, 25 Jun 2025 08:05:15 +0900 Subject: [PATCH 3/4] bump version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4abf716..cf5ad3d 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "keywords": ["rpc"], "homepage": "https://grpc.io", "license": "Apache-2.0", - "version": "1.57.0", + "version": "1.74.0", "require": { "php": ">=7.1.0", "ext-grpc": "*" From 15dadda77146867c2bbd3f167517059c87b74b25 Mon Sep 17 00:00:00 2001 From: Shusaku Yusa Date: Wed, 25 Jun 2025 22:51:59 +0900 Subject: [PATCH 4/4] restore google/auth, sync changes for 1.74.0 --- composer.json | 5 ++++- src/lib/UnaryCall.php | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index cf5ad3d..28e457d 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,10 @@ "version": "1.74.0", "require": { "php": ">=7.1.0", - "ext-grpc": "*" + "google/protobuf": "^v3.3.0" + }, + "require-dev": { + "google/auth": "^v1.3.0" }, "suggest": { "ext-protobuf": "For better performance, install the protobuf C extension.", diff --git a/src/lib/UnaryCall.php b/src/lib/UnaryCall.php index e849649..76d96cc 100644 --- a/src/lib/UnaryCall.php +++ b/src/lib/UnaryCall.php @@ -22,6 +22,8 @@ /** * Represents an active call that sends a single message and then gets a * single response. + * + * @template T of \Google\Protobuf\Internal\Message */ class UnaryCall extends AbstractCall { @@ -50,7 +52,7 @@ public function start($data, array $metadata = [], array $options = []) /** * Wait for the server to respond with data and a status. * - * @return array [response data, status] + * @return array{0: T|null, 1: \stdClass} [response data, status] */ public function wait() {