Skip to content

Releases: dereuromark/cakephp-dto

2.2.1

29 Mar 22:26
Compare
Choose a tag to compare

Fixes

  • Only show changed exit code for verbose or dry-run.

2.2.0

05 Mar 13:14
Compare
Choose a tag to compare

Improvements

Added Enum support, mainly int/string backed enums are now handled gracefully.

Example:

<dto name="FooBar" immutable="true">
	...
	<field name="someUnit" type="\App\Model\Enum\MyUnit"/>
	<field name="someStringBacked" type="\App\Model\Enum\MyStringBacked"/>
	<field name="someIntBacked" type="\App\Model\Enum\MyIntBacked"/>
</dto>

Fixes

Fixed up immutable DTOs for setter (withOrFail instead of setOrFail). Please make sure you are not using the former one.

Full Changelog: 2.1.0...2.2.0

2.1.0

05 Mar 00:28
Compare
Choose a tag to compare

Improvements

Added DTO schema generator from JSON schema or JSON example data
Navigate to

/admin/cake-dto/generate

locally in order to leverage it.

Also:

  • Collision avoidance for singular of collections when that field is already present in the DTO. One must set a different one then to be able to use the collection item methods.
  • Multiple depths of namespace is now supported.

For a live demo see https://sandbox.dereuromark.de/sandbox/dto-examples/generator

2.0.0

28 Sep 17:12
Compare
Choose a tag to compare

CakePHP 5 compatible release

Enjoy DTOs in CakePHP apps the easy way: Minimal configuration, no manual coding needed.

1.8.0

21 Sep 09:12
a7cc9f0
Compare
Choose a tag to compare

Improvements

  • Allow global key type config (Dto::TYPE_DEFAULT by default which uses Dto::TYPE_CAMEL)

1.7.0

10 Sep 15:19
Compare
Choose a tag to compare

Fixes

  • Fixed generation for namespaced plugin names, e.g. Foo/Bar plugin.

Improvements

  • Extending from any DTO compatible class is now possible.

1.6.0

04 Jul 08:49
Compare
Choose a tag to compare

Improvements

  • Allow Dto suffix to be configurable, or removed using empty string.
  • PHP 7.4+ now.

1.5.2

09 Dec 14:59
917f554
Compare
Choose a tag to compare

Fixes

Full Changelog: 1.5.1...1.5.2

1.5.1

14 Nov 12:16
c3c86f8
Compare
Choose a tag to compare

Improvements

  • Allow digits in DTO names
  • Relax file names for DTO configs

1.5.0

15 Dec 22:07
fea80ec
Compare
Choose a tag to compare

Fixes

Serializable

Implementing Serializable interface is deprecated in PHP 8.1 without having the magic methods in place.
Those have now been added. They return associative arrays however and work differently than the explicit serialize() call which returns a string.

Collections

Fixed duplication issue with using collections and name collisions in certain aliasing cases.

Note: This can be BC impacting if you use aliasing here, double-check this before upgrading

Example

<field name="labels" type="FilterElement[]"/>
<field name="brands" type="FilterElement[]"/>

Before, this was creating methods using the singular "FilterElement" instead of "Label" or "Brand".
This is now fixed.