Request.php 984 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. namespace Hyperf\Rpc;
  12. class Request
  13. {
  14. public function __construct(protected string $path, protected array $params, protected null|int|string $id = null, protected ?array $extra = null)
  15. {
  16. }
  17. public function getPath(): string
  18. {
  19. return $this->path;
  20. }
  21. public function setParams(array $params): static
  22. {
  23. $this->params = $params;
  24. return $this;
  25. }
  26. public function getParams(): array
  27. {
  28. return $this->params;
  29. }
  30. public function getId(): null|int|string
  31. {
  32. return $this->id;
  33. }
  34. public function setExtra(?array $extra): void
  35. {
  36. $this->extra = $extra;
  37. }
  38. public function getExtra(): ?array
  39. {
  40. return $this->extra;
  41. }
  42. }