src/Response/OnlineOrder/Tire/GetTiresByOfferResponse.php line 11

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Slivki\Response\OnlineOrder\Tire;
  4. use JsonSerializable;
  5. use Slivki\Dto\Director\DirectorDto;
  6. use Slivki\Dto\Tire\TireDto;
  7. final class GetTiresByOfferResponse implements JsonSerializable
  8. {
  9.     /**
  10.      * @var array<TireDto>
  11.      */
  12.     private array $tires;
  13.     private string $offerUrl;
  14.     private string $companyName;
  15.     private string $topImageUrl;
  16.     private DirectorDto $director;
  17.     private float $rating;
  18.     public function __construct(
  19.         array $tires,
  20.         string $offerUrl,
  21.         string $companyName,
  22.         string $topImageUrl,
  23.         DirectorDto $director,
  24.         float $rating
  25.     ) {
  26.         $this->tires $tires;
  27.         $this->offerUrl $offerUrl;
  28.         $this->companyName $companyName;
  29.         $this->topImageUrl $topImageUrl;
  30.         $this->director $director;
  31.         $this->rating $rating;
  32.     }
  33.     public function jsonSerialize(): array
  34.     {
  35.         return [
  36.             'tires' => $this->tires,
  37.             'offerUrl' => $this->offerUrl,
  38.             'companyName' => $this->companyName,
  39.             'topImageUrl' => $this->topImageUrl,
  40.             'director' => $this->director,
  41.             'rating' => $this->rating,
  42.         ];
  43.     }
  44. }