All notable changes to dto
will be documented in this file.
Updates should follow the Keep a CHANGELOG principles.
- DTO properties inheritance
- Replaced Travis with GitHub actions
- Exception thrown when DTOs do not provide doc-comments (removed as properties may be inherited)
- Support for PHP 8
- Definition of default values in DTOs
- CAMEL_CASE_ARRAY flag to preserve camel case property names when turning a DTO into an array
- Definition of DTO values to dump when calling
var_dump()
- Flags value because of the removal of some flags
- Properties and array keys can now be formatted by
ArrayConverter
- Simplified interactions with flags
- Logic to assign default values based on flags
NULLABLE
flagNOT_NULLABLE
flagNULLABLE_DEFAULT_TO_NULL
flagBOOL_DEFAULT_TO_FALSE
flagARRAY_DEFAULT_TO_EMPTY_ARRAY
flagIncompatibleDtoFlagsException
exception
- Method
getListener()
to ease the listener override
- DTOs can be instantiated with snake case data even though their property names are camel case
CAST_PRIMITIVES
flag to cast values if they are trying to be set with the wrong primitive typemutate()
method to quickly mutate an immutable DTO for the duration of the callbackgetNames()
method to letDtoPropertiesMapper
return the mapped property names- Helper methods for
ArrayConverter
:addConversion()
andremoveConversion()
- Helper methods for
Listener
:addListener()
,removeListener()
andgetListeners()
DtoPropertyValueProcessor
to process property values- Methods to interact with flags:
hasFlags()
,setFlags()
,addFlags()
andremoveFlags()
- When converting a DTO into array, keys are always snake case
- Logic to process property values
- DTO properties in camel case can be mapped with data in snake case
- Method
toArray()
converts a DTO into an array with snake case keys
- Method
toSnakeCaseArray()
: no longer needed as property names are already turned into snake case bytoArray()
- Method
toSnakeCaseArray()
to convert a DTO into an array with snake case keys
- Set values of properties that have not been mapped yet in a partial DTO
- Methods to set and get the array converter
- Throw exception when data has unknown properties, unless they are ignored
- PSR-12 as standard
- Traits to split DTO logic
- Manipulators: array converter, value converter and listener
- Method to get the declared name of a property type
- Method to merge DTOs
- Method to get only some DTO properties
- Method to exclude some DTO properties
- Previous implementation of array converter
- First implementation