cakephp-dto
cakephp-dto copied to clipboard
Default payload type
Hi, thank you for this package it helps enforce some structure & checks at edge level where it is needed but easily skipped!
Something that I find annoying when dealing with underscored/dashed, non default payloads, we always have to be very verbose
new MyDto($content, false, Dto::TYPE_UNDERSCORED);
Would be great if we can specify somewhere else those defaults. For example in the Dto schema
<dto name="MyDto" immutable="true" default_type="under_scored" ignore_missing="false">
...
I like the idea. The only concern I have would be that this seems to easily set different defaults for different dtos And then it can become a mess and you never know what the defaults are.
That said: Maybe we could offer a Configure based global kind of default that would generate them with what you best see fit for it?
Can you test the linked PR? Does it work for you?