src/BusinessFeature/Yclients/Dto/PhoneNumberDto.php line 10

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Slivki\BusinessFeature\Yclients\Dto;
  4. use JsonSerializable;
  5. use OpenApi\Annotations as OA;
  6. final class PhoneNumberDto implements JsonSerializable
  7. {
  8.     /**
  9.      * @var string
  10.      *
  11.      * @OA\Property(
  12.      *     property="phoneNumber",
  13.      *     type="string",
  14.      *     description="Номер телефона",
  15.      *     example="3331300000"
  16.      * )
  17.      */
  18.     private string $phoneNumber;
  19.     /**
  20.      * @var string
  21.      *
  22.      * @OA\Property(
  23.      *     property="label",
  24.      *     type="string",
  25.      *     description="Метка номера телефона",
  26.      *     example="Мобильный"
  27.      * )
  28.      */
  29.     private string $label;
  30.     public function __construct(string $phoneNumberstring $label)
  31.     {
  32.         $this->phoneNumber $phoneNumber;
  33.         $this->label $label;
  34.     }
  35.     public function getPhoneNumber(): string
  36.     {
  37.         return $this->phoneNumber;
  38.     }
  39.     public function getLabel(): string
  40.     {
  41.         return $this->label;
  42.     }
  43.     public function jsonSerialize(): array
  44.     {
  45.         return [
  46.             'phoneNumber' => $this->phoneNumber,
  47.             'label' => $this->label,
  48.         ];
  49.     }
  50. }