brokeyourbike / data-transfer-object
Return original response alongside with the DataTransferObject
Fund package maintenance!
brokeyourbike
Open Collective
Requires
- php: ^8.0
- psr/http-message: ^1.0
- spatie/data-transfer-object: ^3.7
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.4
- mockery/mockery: ^1.4
- phpunit/phpunit: ^9
README
Return original response alongside with the data transfer object
Installation
composer require brokeyourbike/data-transfer-object
Usage
use BrokeYourBike\DataTransferObject\JsonResponse; class SomeDTO extends JsonResponse { public string $name; } assert($response instanceof ResponseInterface); $dto = new SomeDTO($response); assert($response === $dto->getRawResponse());
Authors
- Ivan Stasiuk | Twitter | LinkedIn | stasi.uk