src/BusinessFeature/Yclients/Dto/StaffDto.php line 9

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Slivki\BusinessFeature\Yclients\Dto;
  4. use JsonSerializable;
  5. final class StaffDto implements JsonSerializable
  6. {
  7.     private int $id;
  8.     private string $name;
  9.     private float $rating;
  10.     private string $avatar;
  11.     private string $specialization;
  12.     private ?string $externalLink;
  13.     public function __construct(
  14.         int $id,
  15.         string $name,
  16.         float $rating,
  17.         string $avatar,
  18.         string $specialization,
  19.         ?string $externalLink
  20.     ) {
  21.         $this->id $id;
  22.         $this->name $name;
  23.         $this->rating $rating;
  24.         $this->avatar $avatar;
  25.         $this->specialization $specialization;
  26.         $this->externalLink $externalLink;
  27.     }
  28.     public function jsonSerialize(): array
  29.     {
  30.         return [
  31.             'id' => $this->id,
  32.             'name' => $this->name,
  33.             'rating' => $this->rating,
  34.             'avatar' => $this->avatar,
  35.             'specialization' => $this->specialization,
  36.             'external_link' => $this->externalLink,
  37.         ];
  38.     }
  39. }