vendor/azuracast/php-api-client/src/Dto/UploadFileDto.php line 8

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace AzuraCast\Api\Dto;
  4. use JsonSerializable;
  5. class UploadFileDto implements JsonSerializable
  6. {
  7. /**
  8. * @var string
  9. */
  10. protected $path;
  11. /**
  12. * @var string
  13. */
  14. protected $file;
  15. /**
  16. * @param string $path
  17. * @param string $file
  18. */
  19. public function __construct(string $path, string $file)
  20. {
  21. $this->setPath($path)
  22. ->setFile($file);
  23. }
  24. /**
  25. * @return string
  26. */
  27. public function getPath(): string
  28. {
  29. return $this->path;
  30. }
  31. /**
  32. * @param string $path
  33. *
  34. * @return UploadFileDto
  35. */
  36. public function setPath(string $path): UploadFileDto
  37. {
  38. $this->path = $path;
  39. return $this;
  40. }
  41. /**
  42. * @return string
  43. */
  44. public function getFile(): string
  45. {
  46. return $this->file;
  47. }
  48. /**
  49. * @param string $file
  50. *
  51. * @return UploadFileDto
  52. */
  53. public function setFile(string $file): UploadFileDto
  54. {
  55. $this->file = $file;
  56. return $this;
  57. }
  58. /**
  59. * @return mixed
  60. */
  61. public function jsonSerialize()
  62. {
  63. return [
  64. 'path' => $this->getPath(),
  65. 'file' => base64_encode($this->getFile())
  66. ];
  67. }
  68. }