Request.php 656 B

123456789101112131415161718192021222324252627
  1. <?php
  2. declare(strict_types=1);
  3. namespace Yansongda\Pay;
  4. use JsonSerializable as JsonSerializableInterface;
  5. use Yansongda\Supports\Traits\Accessable;
  6. use Yansongda\Supports\Traits\Arrayable;
  7. use Yansongda\Supports\Traits\Serializable;
  8. class Request extends \GuzzleHttp\Psr7\Request implements JsonSerializableInterface
  9. {
  10. use Accessable;
  11. use Arrayable;
  12. use Serializable;
  13. public function toArray(): array
  14. {
  15. return [
  16. 'url' => $this->getUri()->__toString(),
  17. 'method' => $this->getMethod(),
  18. 'headers' => $this->getHeaders(),
  19. 'body' => (string) $this->getBody(),
  20. ];
  21. }
  22. }