Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*",
Expand Down
6 changes: 3 additions & 3 deletions packages/grpc/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
13 changes: 6 additions & 7 deletions tests/ServerStreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
);
Expand All @@ -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,
);
Expand All @@ -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)),
],
];

Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/Chat/Api/V1/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/Chat/Api/V1/MessengerServiceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/Chat/Api/V1/MessengerServiceServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/Chat/Api/V1/autoload.metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/Echos/Api/V1/EchoRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/Echos/Api/V1/EchoResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/Echos/Api/V1/EchoServiceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/Echos/Api/V1/EchoServiceServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/Echos/Api/V1/EchoServiceServerRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/Echos/Api/V1/autoload.metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/File/Api/V1/Chunk.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/File/Api/V1/FileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/File/Api/V1/FileServiceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/File/Api/V1/FileServiceServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/File/Api/V1/FileServiceServerRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/File/Api/V1/autoload.metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/Topic/Api/V1/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/Topic/Api/V1/SubscribeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/Topic/Api/V1/TopicServiceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/Topic/Api/V1/TopicServiceServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/Topic/Api/V1/TopicServiceServerRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/genproto/Topic/Api/V1/autoload.metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

Expand Down