-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Message Object Access in Interceptors for gRPC Component (#92)
* Add Message Object Access in Interceptors for gRPC Component fixes #90 * Fix CS * Remove extra parameter * Add psalm-suppress * Remove Redundant `assertInputType` Method from `Invoker.php` This change is due to the `Spiral\RoadRunner\GRPC\Method` class already performing checks on `in` and `out` parameters during the service class parsing phase. Therefore, it's unnecessary to repeat this check in the `Invoker.php` file. * fix --------- Co-authored-by: Maxim Smakouz <[email protected]>
- Loading branch information
1 parent
43458fe
commit f428e6b
Showing
14 changed files
with
208 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,5 @@ build | |
clover.xml | ||
.env | ||
builds | ||
|
||
.phpunit.result.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,3 +74,4 @@ enabled: | |
finder: | ||
exclude: | ||
- "tests/app/GRPC/Generator" | ||
- "tests/generated" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
# Generated by the protocol buffer compiler (spiral/php-grpc). DO NOT EDIT! | ||
# source: ping.proto | ||
|
||
namespace Service; | ||
|
||
use Spiral\RoadRunner\GRPC; | ||
|
||
interface PingInterface extends GRPC\ServiceInterface | ||
{ | ||
// GRPC specific service name. | ||
public const NAME = "service.Ping"; | ||
|
||
/** | ||
* @param GRPC\ContextInterface $ctx | ||
* @param Message $in | ||
* @return Message | ||
* | ||
* @throws GRPC\Exception\InvokeException | ||
*/ | ||
public function Ping(GRPC\ContextInterface $ctx, Message $in): Message; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Service; | ||
|
||
use Spiral\RoadRunner\GRPC\ContextInterface; | ||
|
||
class PingService implements PingInterface | ||
{ | ||
public function Ping(ContextInterface $ctx, Message $in): Message | ||
{ | ||
$out = new Message(); | ||
|
||
return $out->setMsg('PONG'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters