src/Dto/Settings/PriceSettingsDto.php line 10

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Slivki\Dto\Settings;
  4. use JsonSerializable;
  5. use OpenApi\Annotations as OA;
  6. final class PriceSettingsDto implements JsonSerializable
  7. {
  8.     /**
  9.      * @OA\Property(
  10.      *     property="minPrice",
  11.      *     description="Минимальная цена",
  12.      *     example="1.25",
  13.      * )
  14.      */
  15.     private float $minPrice;
  16.     /**
  17.      * @OA\Property(
  18.      *     property="maxPrice",
  19.      *     description="Максимальная цена",
  20.      *     example="234.50",
  21.      * )
  22.      */
  23.     private float $maxPrice;
  24.     public function __construct(float $minPricefloat $maxPrice)
  25.     {
  26.         $this->minPrice $minPrice;
  27.         $this->maxPrice $maxPrice;
  28.     }
  29.     public function jsonSerialize(): array
  30.     {
  31.         return [
  32.             'minPrice' => $this->minPrice,
  33.             'maxPrice' => $this->maxPrice,
  34.         ];
  35.     }
  36. }