brokeyourbike/data-transfer-object

Return original response alongside with the DataTransferObject

0.2.1 2023-05-14 22:29 UTC

This package is auto-updated.

Last update: 2024-03-30 00:24:30 UTC


README

Latest Stable Version Total Downloads Maintainability Test Coverage

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

License

Mozilla Public License v2.0