GreeterStub.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. // GENERATED CODE -- DO NOT EDIT!
  3. // Original file comments:
  4. // Copyright 2015 gRPC authors.
  5. //
  6. // Licensed under the Apache License, Version 2.0 (the "License");
  7. // you may not use this file except in compliance with the License.
  8. // You may obtain a copy of the License at
  9. //
  10. // http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. // Unless required by applicable law or agreed to in writing, software
  13. // distributed under the License is distributed on an "AS IS" BASIS,
  14. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. // See the License for the specific language governing permissions and
  16. // limitations under the License.
  17. //
  18. namespace Helloworld;
  19. /**
  20. * The greeting service definition.
  21. */
  22. class GreeterStub {
  23. /**
  24. * Sends a greeting
  25. * @param \Helloworld\HelloRequest $request client request
  26. * @param \Grpc\ServerContext $context server request context
  27. * @return \Helloworld\HelloReply for response data, null if if error occured
  28. * initial metadata (if any) and status (if not ok) should be set to $context
  29. */
  30. public function SayHello(
  31. \Helloworld\HelloRequest $request,
  32. \Grpc\ServerContext $context
  33. ): ?\Helloworld\HelloReply {
  34. $context->setStatus(\Grpc\Status::unimplemented());
  35. return null;
  36. }
  37. /**
  38. * Get the method descriptors of the service for server registration
  39. *
  40. * @return array of \Grpc\MethodDescriptor for the service methods
  41. */
  42. public final function getMethodDescriptors(): array
  43. {
  44. return [
  45. '/helloworld.Greeter/SayHello' => new \Grpc\MethodDescriptor(
  46. $this,
  47. 'SayHello',
  48. '\Helloworld\HelloRequest',
  49. \Grpc\MethodDescriptor::UNARY_CALL
  50. ),
  51. ];
  52. }
  53. }