brokeyourbike/data-transfer-object

Return original response alongside with the DataTransferObject

Fund package maintenance!
brokeyourbike
Open Collective

Installs: 3 633

Dependents: 31

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

pkg:composer/brokeyourbike/data-transfer-object

0.2.1 2023-05-14 22:29 UTC

This package is auto-updated.

Last update: 2025-09-29 02:58:44 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