src/Response/FoodCourt/Category/CategoryResponse.php line 7

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Slivki\Response\FoodCourt\Category;
  4. final class CategoryResponse implements \JsonSerializable
  5. {
  6.     private int $id;
  7.     private int $count;
  8.     private string $name;
  9.     public function __construct(
  10.         int $id,
  11.         int $count,
  12.         string $name
  13.     ) {
  14.         $this->id $id;
  15.         $this->count $count;
  16.         $this->name $name;
  17.     }
  18.     public function jsonSerialize(): array
  19.     {
  20.         return [
  21.             'id' => $this->id,
  22.             'name' => $this->name,
  23.             'count' => $this->count,
  24.         ];
  25.     }
  26. }