cakephp-dto

CakePHP DTO plugin - quickly generate useful data transfer objects for your app (mutable/immutable)

MIT License

Downloads
61.6K
Stars
24
Committers
6
cakephp-dto - 1.0.0-rc2

Published by dereuromark over 4 years ago

RC for CakePHP 4

  • Using new cakephp/twig plugin.
cakephp-dto - 1.0.0-beta

Published by dereuromark almost 5 years ago

CakePHP 4 compatible pre-release.

Please help to finalize for stable release.

cakephp-dto - 0.2.7

Published by dereuromark almost 5 years ago

Improvements

Defining a singular automatically sets collection to true.

cakephp-dto - 0.2.6

Published by dereuromark over 5 years ago

Improvement

Add read() nullable path reading as convenience wrapper to make this similar to Entity ReadTrait usage.

cakephp-dto - 0.2.5

Published by dereuromark over 5 years ago

Bugfixes

Fixed toArray() for empty collections to be not null but [].

cakephp-dto - 0.2.4

Published by dereuromark over 5 years ago

Bugfixes

Fixed auto-detect of PHP7.1+

cakephp-dto - 0.2.3

Published by dereuromark over 5 years ago

Improvements

Associative arrays can now be string|int. Usually, assoc always means string keys.
But in some cases, integer could also be OK, e.g. when using primary keys as key.
PHPStan etc should not report an error here then, as such the strict string typehint has been removed for $key.

cakephp-dto - 0.2.2

Published by dereuromark almost 6 years ago

Improvements

Union type support added

    <field name="service" type="string|int|float"/>

or even

    <field name="service" type="string[]|int[]"/>

is possible now

cakephp-dto - 0.2.1

Published by dereuromark almost 6 years ago

Bugfixes

  • Disallow set() and property write access for immutable DTOs.
  • Provide with() for immutable DTOs.
cakephp-dto - 0.2.0

Published by dereuromark almost 6 years ago

Improvements

  • Removed ArrayAccess
  • Instead added property access and get(), set(), has() convenience methods
cakephp-dto - 0.1.3

Published by dereuromark almost 6 years ago

Improvements

Allow fromArray() to auto-add keys for associative arrays if that "key" exists in the incoming data.

Bugfixes

Fix toArray()/fromArray() for array collections.

cakephp-dto - 0.1.2

Published by dereuromark almost 6 years ago

Improvements

Added namespaced DTOs.
This way you can have multiple of the same name, as long as they are under different subfolders and not used together or aliased.

Bugfixes

Fix mixed type for fields.

cakephp-dto - 0.1.1

Published by dereuromark almost 6 years ago

Improvements

Default values auto-require the field now (not nullable) unless specified differently.

cakephp-dto - 0.1

Published by dereuromark almost 6 years ago

Initial Release

You can try out this package now as stable one.
Please give some feedback or provide ideas for improvement, either as issue or PR.

Package Rankings
Top 7.08% on Packagist.org
Badges
Extracted from project README
CI codecov Minimum PHP Version Coding Standards