Loading app/src/Restaurants/Collection/RestaurantListingElementCollection.php +9 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,15 @@ namespace App\Restaurants\Collection; class RestaurantLisitngElementCollection use App\Restaurants\Dto\RestaurantListingElementDto; use App\Shared\Collection\DtoCollection; class RestaurantListingElementCollection extends DtoCollection { private string $collectionType = RestaurantListingElementDto::class; public function __construct(array $data = []) { parent::__construct($this->collectionType, $data); } } No newline at end of file app/src/Restaurants/Dto/RestaurantListDto.php +3 −3 Original line number Diff line number Diff line Loading @@ -2,19 +2,19 @@ namespace App\Restaurants\Dto; use App\Shared\Collection\ListingCollection; use App\Restaurants\Collection\RestaurantListingElementCollection; use App\Shared\Dto\PaginationDto; class RestaurantListDto { /** * @param PaginationDto $pagination * @param ListingCollection<RestaurantListingElementDto> $list * @param RestaurantListingElementCollection<RestaurantListingElementDto> $list * @param RestaurantFilterVariantsDto $filterVariants */ public function __construct( public PaginationDto $pagination, public ListingCollection $list, public RestaurantListingElementCollection $list, public RestaurantFilterVariantsDto $filterVariants, ) {} } app/src/Restaurants/DtoFactory/RestaurantListDtoFactory.php +3 −3 Original line number Diff line number Diff line Loading @@ -2,23 +2,23 @@ namespace App\Restaurants\DtoFactory; use App\Restaurants\Collection\RestaurantListingElementCollection; use App\Restaurants\Dto\RestaurantFilterVariantsDto; use App\Restaurants\Dto\RestaurantListDto; use App\Restaurants\Dto\RestaurantListingElementDto; use App\Shared\Collection\ListingCollection; use App\Shared\Dto\PaginationDto; class RestaurantListDtoFactory { /** * @param PaginationDto $pagination * @param ListingCollection<RestaurantListingElementDto> $list * @param RestaurantListingElementCollection<RestaurantListingElementDto> $list * @param RestaurantFilterVariantsDto $filters * @return RestaurantListDto */ public function create( PaginationDto $pagination, ListingCollection $list, RestaurantListingElementCollection $list, RestaurantFilterVariantsDto $filters ): RestaurantListDto { return new RestaurantListDto( Loading app/src/Restaurants/DtoFactory/RestaurantListingElementDtoFactory.php +4 −4 Original line number Diff line number Diff line Loading @@ -2,8 +2,8 @@ namespace App\Restaurants\DtoFactory; use App\Restaurants\Collection\RestaurantListingElementCollection; use App\Restaurants\Dto\RestaurantListingElementDto; use App\Shared\Collection\ListingCollection; use App\Shared\DtoFactory\FileDtoFactory; use App\Shared\Entity\Restaurants; use Ramsey\Collection\Collection; Loading @@ -29,14 +29,14 @@ class RestaurantListingElementDtoFactory /** * @param Collection<Restaurants> $restaurants * @return ListingCollection<RestaurantListingElementDto> * @return RestaurantListingElementCollection<RestaurantListingElementDto> */ public function createCollection(Collection $restaurants): ListingCollection public function createCollection(Collection $restaurants): RestaurantListingElementCollection { $restaurantsDto = $restaurants->map(function(Restaurants $restaurant) { return $this->create($restaurant); }); return new ListingCollection($restaurantsDto->toArray()); return new RestaurantListingElementCollection($restaurantsDto->toArray()); } } Loading
app/src/Restaurants/Collection/RestaurantListingElementCollection.php +9 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,15 @@ namespace App\Restaurants\Collection; class RestaurantLisitngElementCollection use App\Restaurants\Dto\RestaurantListingElementDto; use App\Shared\Collection\DtoCollection; class RestaurantListingElementCollection extends DtoCollection { private string $collectionType = RestaurantListingElementDto::class; public function __construct(array $data = []) { parent::__construct($this->collectionType, $data); } } No newline at end of file
app/src/Restaurants/Dto/RestaurantListDto.php +3 −3 Original line number Diff line number Diff line Loading @@ -2,19 +2,19 @@ namespace App\Restaurants\Dto; use App\Shared\Collection\ListingCollection; use App\Restaurants\Collection\RestaurantListingElementCollection; use App\Shared\Dto\PaginationDto; class RestaurantListDto { /** * @param PaginationDto $pagination * @param ListingCollection<RestaurantListingElementDto> $list * @param RestaurantListingElementCollection<RestaurantListingElementDto> $list * @param RestaurantFilterVariantsDto $filterVariants */ public function __construct( public PaginationDto $pagination, public ListingCollection $list, public RestaurantListingElementCollection $list, public RestaurantFilterVariantsDto $filterVariants, ) {} }
app/src/Restaurants/DtoFactory/RestaurantListDtoFactory.php +3 −3 Original line number Diff line number Diff line Loading @@ -2,23 +2,23 @@ namespace App\Restaurants\DtoFactory; use App\Restaurants\Collection\RestaurantListingElementCollection; use App\Restaurants\Dto\RestaurantFilterVariantsDto; use App\Restaurants\Dto\RestaurantListDto; use App\Restaurants\Dto\RestaurantListingElementDto; use App\Shared\Collection\ListingCollection; use App\Shared\Dto\PaginationDto; class RestaurantListDtoFactory { /** * @param PaginationDto $pagination * @param ListingCollection<RestaurantListingElementDto> $list * @param RestaurantListingElementCollection<RestaurantListingElementDto> $list * @param RestaurantFilterVariantsDto $filters * @return RestaurantListDto */ public function create( PaginationDto $pagination, ListingCollection $list, RestaurantListingElementCollection $list, RestaurantFilterVariantsDto $filters ): RestaurantListDto { return new RestaurantListDto( Loading
app/src/Restaurants/DtoFactory/RestaurantListingElementDtoFactory.php +4 −4 Original line number Diff line number Diff line Loading @@ -2,8 +2,8 @@ namespace App\Restaurants\DtoFactory; use App\Restaurants\Collection\RestaurantListingElementCollection; use App\Restaurants\Dto\RestaurantListingElementDto; use App\Shared\Collection\ListingCollection; use App\Shared\DtoFactory\FileDtoFactory; use App\Shared\Entity\Restaurants; use Ramsey\Collection\Collection; Loading @@ -29,14 +29,14 @@ class RestaurantListingElementDtoFactory /** * @param Collection<Restaurants> $restaurants * @return ListingCollection<RestaurantListingElementDto> * @return RestaurantListingElementCollection<RestaurantListingElementDto> */ public function createCollection(Collection $restaurants): ListingCollection public function createCollection(Collection $restaurants): RestaurantListingElementCollection { $restaurantsDto = $restaurants->map(function(Restaurants $restaurant) { return $this->create($restaurant); }); return new ListingCollection($restaurantsDto->toArray()); return new RestaurantListingElementCollection($restaurantsDto->toArray()); } }