Use the PhpDocExtractor in addition to the ReflectionExtractor. #125
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've added the
PhpDocExtractor
in addition to theReflectionExtractor
which allows you to use the phpdoc to decode data properly. That also works in tandem with the array denormalizer (which I've added to theverbs.php
). Its typically default behaviour to include thePhpDocExtractor
when the https://symfony.com/doc/current/components/property_info.html#phpdocextractorI also fixed a bug with the
NormalizeToPropertiesAndClassName
. If the required parameters count is 0 and there's data, theArr::has(
will return true causing it to fail for no reason. I found that because theDTO
class wouldn't serialise for me. I believe theallows us to store a serializable class as a property
test isn't actually testing anything, otherwise it should've caught it - I wasn't sure so I didn't delete it.I also believe now the deserialiser is more robust, the BackedEnum code can be removed and I wrote a test to try prove to myself its working fine - but do as you please with that.