All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Added interface for custom constructor resolution
- Skip parsing of closure use statements
- Default to empty array in default serializer repository
- Allow skipping public method serialization
- Allow hydrating an array of enums.
- Serialize unit enums to their name.
- [Regression] Casters returning null causes problem for hydrator enums.
- Naive property type resolving now handles a bunch more cases.
- Only try to resolve one property from the docblock to prevent parsing error (#50)
- This is not a joke release.
MapperSettings
can now also be specified using an interface.
- Added ability to define polymorhic object mapping (#29)
- Add mixed as native type in NaivePropertyTypeResolver (#40)
- Ensure generic template is of object type (#36)
- Prevent method name collisions in case SomeThing and Some\Thing both exist
- Corrected @template generic usage for generated hydrator
- Prevented exception when scalar type is resolved from a docblock
- Added ability to omit all public method from serialization.
- Added ability to omit all public properties from serialization.
- Added ability to omit specific public methods and properties from serialization.
- Functionally equivalent to 0.5.5, stable release.
- Support nullable enum properties #28
- Fix typo in PHPDoc parser regex pattern #27
- Fix cache keys colliding when using multiple casters without options #26
- Ignore use function/const statements when resolving the use statement map (#25)
- Handle omission of data for nullable parameters and parameters with a default
- Expose missing fields in UnableToHydrate exception.
- Added information about which property caused hydration failure.
- Prevent type-error when casting null values for nullable properties (#23)
- Fixed phpstan template notations.
- The
CastToDateTimeImmutable
caster now supports setting a timezone.
- The
ObjectHydrator
class was deprecated, useObjectMapperUsingReflection
and hint against the newObjectMapper
interface. - The
ListOfObjects
class was deprecated, use theIterableList
object instead. - The
KeyFormattingWithoutConversion
class was deprecated, use theKeyFormatterWithoutConversion
class instead.
- The
ObjectHydrator
class was converted into an interface namedObjectMapper
, the main implementation isObjectMapperUsingReflection
. - The
PropertyDefintion
class was renamed toPropertyHydrationDefinition
to be symmetrical with the newPropertySerializationDefinition
. - The
DefinitionProvider::provideDefinition
method was deprecated in favour of the newprovideHydrationDefinition
for symmetry withprovideSerializationDefinition
. - The
KeyFormatter
interface was changed by adding akeyToPropertyName
method, needed for serialization. - The
ObjectHydrator::hydrateObjects
return type class was renamed fromListOfObjects
toIterableList
.
- The
ObjectMapper
interface was introduced, which represents both generated and reflection based mappers. - [Major Feature] Serialization was added to the main
ObjectHydrator
interface. - Array hydration now also has rudimentary support for docblock type hints (
@param Type[] $name
,@param array<Type> $name
,@param array<string, Type> $name
).
- Allow same hydrator to be used with different constructor options.
- Added ability to define nested input (#12)
- Added
hydrateObjects
; a way to hydrate a list of objects in one go
- Initial implementation of the object hydrator