diff --git a/Makefile b/Makefile index 488aee1..3c3406c 100644 --- a/Makefile +++ b/Makefile @@ -133,6 +133,17 @@ fix: fixer rector composer-normalize ## Run all fixing recipes check: fixer-check rector-check composer-validate composer-normalize-check deps-analyze phpstan test ## Run all project checks .PHONY: check +compile-stub: + docker run --rm \ + --pull always \ + --user $(CONTAINER_USER) \ + -v $(PWD):/workspace \ + -w /workspace \ + ghcr.io/thesis-php/protoc-plugin:latest \ + --php-plugin_out=genproto \ + protos/*.proto +.PHONY: compile-stub + compile-test-stub: docker run --rm \ --pull always \ diff --git a/composer.json b/composer.json index 5b9de30..c14f6b0 100644 --- a/composer.json +++ b/composer.json @@ -34,10 +34,10 @@ "psr/log": "^3.0", "revolt/event-loop": "^1.0.8", "thesis/endian": "^0.3.3", - "thesis/googleapis-rpc-types": "^0.1.6", + "thesis/googleapis-rpc-types": "^0.2", "thesis/package-version": "^0.1.2", - "thesis/protobuf": "^0.1.8", - "thesis/protobuf-known-types": "^0.1.7" + "thesis/protobuf": "^0.2", + "thesis/protobuf-known-types": "^0.2" }, "require-dev": { "ext-bcmath": "*", diff --git a/packages/grpc/composer.json b/packages/grpc/composer.json index 800ab1d..46ba9ab 100644 --- a/packages/grpc/composer.json +++ b/packages/grpc/composer.json @@ -25,10 +25,10 @@ "amphp/pipeline": "^1.2", "revolt/event-loop": "^1.0.8", "thesis/endian": "^0.3.3", - "thesis/googleapis-rpc-types": "^0.1.6", + "thesis/googleapis-rpc-types": "^0.2", "thesis/package-version": "^0.1.2", - "thesis/protobuf": "^0.1.8", - "thesis/protobuf-known-types": "^0.1.5" + "thesis/protobuf": "^0.2", + "thesis/protobuf-known-types": "^0.2" }, "autoload": { "psr-4": { diff --git a/tests/ServerStreamTest.php b/tests/ServerStreamTest.php index 3a1389c..bdc7b4e 100644 --- a/tests/ServerStreamTest.php +++ b/tests/ServerStreamTest.php @@ -5,7 +5,6 @@ namespace Thesis\Grpc; use Amp\Cancellation; -use BcMath\Number; use Google\Protobuf\Timestamp; use Google\Rpc\Code; use PHPUnit\Framework\Attributes\CoversClass; @@ -51,8 +50,8 @@ public function testServerStream(): void self::assertCount(2, $paymentEvents); self::assertEquals( [ - new Event('payment_finished', '{"id": 1}', new Timestamp(new Number(1_771_782_096))), - new Event('payment_rejected', '{"id": 2}', new Timestamp(new Number(1_771_782_097))), + new Event('payment_finished', '{"id": 1}', new Timestamp(1_771_782_096)), + new Event('payment_rejected', '{"id": 2}', new Timestamp(1_771_782_097)), ], $paymentEvents, ); @@ -64,7 +63,7 @@ public function testServerStream(): void self::assertCount(1, $subscriptionEvents); self::assertEquals( [ - new Event('subscription_terminated', '{"id": 1}', new Timestamp(new Number(1_771_782_099))), + new Event('subscription_terminated', '{"id": 1}', new Timestamp(1_771_782_099)), ], $subscriptionEvents, ); @@ -85,11 +84,11 @@ public function subscribe( ): iterable { $events = [ 'payments' => [ - new Event('payment_finished', '{"id": 1}', new Timestamp(new Number(1_771_782_096))), - new Event('payment_rejected', '{"id": 2}', new Timestamp(new Number(1_771_782_097))), + new Event('payment_finished', '{"id": 1}', new Timestamp(1_771_782_096)), + new Event('payment_rejected', '{"id": 2}', new Timestamp(1_771_782_097)), ], 'subscriptions' => [ - new Event('subscription_terminated', '{"id": 1}', new Timestamp(new Number(1_771_782_099))), + new Event('subscription_terminated', '{"id": 1}', new Timestamp(1_771_782_099)), ], ]; diff --git a/tests/genproto/Chat/Api/V1/Message.php b/tests/genproto/Chat/Api/V1/Message.php index daac228..332292f 100644 --- a/tests/genproto/Chat/Api/V1/Message.php +++ b/tests/genproto/Chat/Api/V1/Message.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/chat_v1.proto */ diff --git a/tests/genproto/Chat/Api/V1/MessengerServiceClient.php b/tests/genproto/Chat/Api/V1/MessengerServiceClient.php index a706240..0c44d1f 100644 --- a/tests/genproto/Chat/Api/V1/MessengerServiceClient.php +++ b/tests/genproto/Chat/Api/V1/MessengerServiceClient.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/chat_v1.proto */ diff --git a/tests/genproto/Chat/Api/V1/MessengerServiceServer.php b/tests/genproto/Chat/Api/V1/MessengerServiceServer.php index 938ffc0..6c9ea72 100644 --- a/tests/genproto/Chat/Api/V1/MessengerServiceServer.php +++ b/tests/genproto/Chat/Api/V1/MessengerServiceServer.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/chat_v1.proto */ diff --git a/tests/genproto/Chat/Api/V1/MessengerServiceServerRegistry.php b/tests/genproto/Chat/Api/V1/MessengerServiceServerRegistry.php index 78fc775..bb5d527 100644 --- a/tests/genproto/Chat/Api/V1/MessengerServiceServerRegistry.php +++ b/tests/genproto/Chat/Api/V1/MessengerServiceServerRegistry.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/chat_v1.proto */ diff --git a/tests/genproto/Chat/Api/V1/TestsProtosChatV1DescriptorRegistry.php b/tests/genproto/Chat/Api/V1/TestsProtosChatV1DescriptorRegistry.php index 9e7cfd2..b1e00c6 100644 --- a/tests/genproto/Chat/Api/V1/TestsProtosChatV1DescriptorRegistry.php +++ b/tests/genproto/Chat/Api/V1/TestsProtosChatV1DescriptorRegistry.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/chat_v1.proto */ diff --git a/tests/genproto/Chat/Api/V1/autoload.metadata.php b/tests/genproto/Chat/Api/V1/autoload.metadata.php index 54e4295..f2267d7 100644 --- a/tests/genproto/Chat/Api/V1/autoload.metadata.php +++ b/tests/genproto/Chat/Api/V1/autoload.metadata.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 */ diff --git a/tests/genproto/Echos/Api/V1/EchoRequest.php b/tests/genproto/Echos/Api/V1/EchoRequest.php index 637fbbb..62a0de2 100644 --- a/tests/genproto/Echos/Api/V1/EchoRequest.php +++ b/tests/genproto/Echos/Api/V1/EchoRequest.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/echo_v1.proto */ diff --git a/tests/genproto/Echos/Api/V1/EchoResponse.php b/tests/genproto/Echos/Api/V1/EchoResponse.php index 8e076ba..d84dd03 100644 --- a/tests/genproto/Echos/Api/V1/EchoResponse.php +++ b/tests/genproto/Echos/Api/V1/EchoResponse.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/echo_v1.proto */ diff --git a/tests/genproto/Echos/Api/V1/EchoServiceClient.php b/tests/genproto/Echos/Api/V1/EchoServiceClient.php index 700d41d..deb49b4 100644 --- a/tests/genproto/Echos/Api/V1/EchoServiceClient.php +++ b/tests/genproto/Echos/Api/V1/EchoServiceClient.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/echo_v1.proto */ diff --git a/tests/genproto/Echos/Api/V1/EchoServiceServer.php b/tests/genproto/Echos/Api/V1/EchoServiceServer.php index d731c7c..b75d8ec 100644 --- a/tests/genproto/Echos/Api/V1/EchoServiceServer.php +++ b/tests/genproto/Echos/Api/V1/EchoServiceServer.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/echo_v1.proto */ diff --git a/tests/genproto/Echos/Api/V1/EchoServiceServerRegistry.php b/tests/genproto/Echos/Api/V1/EchoServiceServerRegistry.php index ed5ceab..78c85e0 100644 --- a/tests/genproto/Echos/Api/V1/EchoServiceServerRegistry.php +++ b/tests/genproto/Echos/Api/V1/EchoServiceServerRegistry.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/echo_v1.proto */ diff --git a/tests/genproto/Echos/Api/V1/TestsProtosEchoV1DescriptorRegistry.php b/tests/genproto/Echos/Api/V1/TestsProtosEchoV1DescriptorRegistry.php index 6a99d74..137d7bf 100644 --- a/tests/genproto/Echos/Api/V1/TestsProtosEchoV1DescriptorRegistry.php +++ b/tests/genproto/Echos/Api/V1/TestsProtosEchoV1DescriptorRegistry.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/echo_v1.proto */ diff --git a/tests/genproto/Echos/Api/V1/autoload.metadata.php b/tests/genproto/Echos/Api/V1/autoload.metadata.php index 4d98e44..5179801 100644 --- a/tests/genproto/Echos/Api/V1/autoload.metadata.php +++ b/tests/genproto/Echos/Api/V1/autoload.metadata.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 */ diff --git a/tests/genproto/File/Api/V1/Chunk.php b/tests/genproto/File/Api/V1/Chunk.php index 6279759..46ce8dc 100644 --- a/tests/genproto/File/Api/V1/Chunk.php +++ b/tests/genproto/File/Api/V1/Chunk.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/file_v1.proto */ diff --git a/tests/genproto/File/Api/V1/FileInfo.php b/tests/genproto/File/Api/V1/FileInfo.php index 6ecdfa8..b9e2e98 100644 --- a/tests/genproto/File/Api/V1/FileInfo.php +++ b/tests/genproto/File/Api/V1/FileInfo.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/file_v1.proto */ diff --git a/tests/genproto/File/Api/V1/FileServiceClient.php b/tests/genproto/File/Api/V1/FileServiceClient.php index 4efd3cf..546a9da 100644 --- a/tests/genproto/File/Api/V1/FileServiceClient.php +++ b/tests/genproto/File/Api/V1/FileServiceClient.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/file_v1.proto */ diff --git a/tests/genproto/File/Api/V1/FileServiceServer.php b/tests/genproto/File/Api/V1/FileServiceServer.php index e80285e..00b211f 100644 --- a/tests/genproto/File/Api/V1/FileServiceServer.php +++ b/tests/genproto/File/Api/V1/FileServiceServer.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/file_v1.proto */ diff --git a/tests/genproto/File/Api/V1/FileServiceServerRegistry.php b/tests/genproto/File/Api/V1/FileServiceServerRegistry.php index 3c1216a..0893cd6 100644 --- a/tests/genproto/File/Api/V1/FileServiceServerRegistry.php +++ b/tests/genproto/File/Api/V1/FileServiceServerRegistry.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/file_v1.proto */ diff --git a/tests/genproto/File/Api/V1/TestsProtosFileV1DescriptorRegistry.php b/tests/genproto/File/Api/V1/TestsProtosFileV1DescriptorRegistry.php index b93aa24..e9e6eca 100644 --- a/tests/genproto/File/Api/V1/TestsProtosFileV1DescriptorRegistry.php +++ b/tests/genproto/File/Api/V1/TestsProtosFileV1DescriptorRegistry.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/file_v1.proto */ diff --git a/tests/genproto/File/Api/V1/autoload.metadata.php b/tests/genproto/File/Api/V1/autoload.metadata.php index 9d5c37a..4fed2cd 100644 --- a/tests/genproto/File/Api/V1/autoload.metadata.php +++ b/tests/genproto/File/Api/V1/autoload.metadata.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 */ diff --git a/tests/genproto/Topic/Api/V1/Event.php b/tests/genproto/Topic/Api/V1/Event.php index 3c5b0a4..368557e 100644 --- a/tests/genproto/Topic/Api/V1/Event.php +++ b/tests/genproto/Topic/Api/V1/Event.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/topic_v1.proto */ diff --git a/tests/genproto/Topic/Api/V1/SubscribeRequest.php b/tests/genproto/Topic/Api/V1/SubscribeRequest.php index d8bef44..474a9ea 100644 --- a/tests/genproto/Topic/Api/V1/SubscribeRequest.php +++ b/tests/genproto/Topic/Api/V1/SubscribeRequest.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/topic_v1.proto */ diff --git a/tests/genproto/Topic/Api/V1/TestsProtosTopicV1DescriptorRegistry.php b/tests/genproto/Topic/Api/V1/TestsProtosTopicV1DescriptorRegistry.php index 91609a1..dc068f9 100644 --- a/tests/genproto/Topic/Api/V1/TestsProtosTopicV1DescriptorRegistry.php +++ b/tests/genproto/Topic/Api/V1/TestsProtosTopicV1DescriptorRegistry.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/topic_v1.proto */ diff --git a/tests/genproto/Topic/Api/V1/TopicServiceClient.php b/tests/genproto/Topic/Api/V1/TopicServiceClient.php index e2a538e..3b28954 100644 --- a/tests/genproto/Topic/Api/V1/TopicServiceClient.php +++ b/tests/genproto/Topic/Api/V1/TopicServiceClient.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/topic_v1.proto */ diff --git a/tests/genproto/Topic/Api/V1/TopicServiceServer.php b/tests/genproto/Topic/Api/V1/TopicServiceServer.php index 96e42e0..52d8da4 100644 --- a/tests/genproto/Topic/Api/V1/TopicServiceServer.php +++ b/tests/genproto/Topic/Api/V1/TopicServiceServer.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/topic_v1.proto */ diff --git a/tests/genproto/Topic/Api/V1/TopicServiceServerRegistry.php b/tests/genproto/Topic/Api/V1/TopicServiceServerRegistry.php index 3826682..27d3781 100644 --- a/tests/genproto/Topic/Api/V1/TopicServiceServerRegistry.php +++ b/tests/genproto/Topic/Api/V1/TopicServiceServerRegistry.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 * Source: tests/protos/topic_v1.proto */ diff --git a/tests/genproto/Topic/Api/V1/autoload.metadata.php b/tests/genproto/Topic/Api/V1/autoload.metadata.php index 53474ae..156170d 100644 --- a/tests/genproto/Topic/Api/V1/autoload.metadata.php +++ b/tests/genproto/Topic/Api/V1/autoload.metadata.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.2.0 + * thesis/protoc-plugin — v0.3.0 * protoc — v6.33.5 */