1. Go to this page and download the library: Download onmoon/dto-mapper library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
onmoon / dto-mapper example snippets
public function showPetById(int $petId) : ShowPetByIdResponseDto
{
$pet = $this->pets->getById($petId);
$mapper = new OnMoon\DtoMapper\DtoMapper();
return $mapper->map($pet, ShowPetByIdResponseDto::class);
}