Skip to content

Latest commit

 

History

History
500 lines (402 loc) · 30.2 KB

File metadata and controls

500 lines (402 loc) · 30.2 KB

Changelog

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.

Unreleased

10.1.0 - 2026-18-03

Added

  • GH#328 Register mappers as lazy to reduce initialization calls when sub mappers are not used

Fixed

  • GH#333 Fix incompatibility with class-string<object> notation
  • GH#330 Cast inner values of array properties when mapping from untyped sources

Documentation

  • GH#332 Update interface name in transformer documentation for compute
  • GH#331 Fix syntax error in supports method return statement example
  • GH#329 Fix some typos

10.0.3 - 2025-25-02

  • GH#327 Fix cache extractor in symfony bundle being mixed between source and target.

10.0.2 - 2025-24-02

Fixed

  • GH#326 Fix array, be consistent with old behavior, undefined array should be mapped with their keys.

10.0.1 - 2025-24-02

Fixed

  • GH#325 Fix creating union or intersection type when not enough types.

10.0.0 - 2025-10-02

Added

  • GH#297 Support PHP 8.5 and Symfony 8, this library now use the TypeInfo Component for types instead of PropertyInfo directly.
  • GH#297 Debug command now show the type of each property mapped, transformers will also display more information.
  • GH#297 Profiler now show the type of each property mapped, transformers will also display more information.
  • GH#304 Allow to override source and/or target property type.
  • GH#314 Add support for static callable in attribute transformer.
  • GH#317 Initial support for nested properties.
  • GH#318 Add support for lazy mapping.
  • GH#316 Add support for object invokable transformer in attribute transformer.
  • GH#319 Add support for discriminator with Mapper attribute.
  • GH#320 Add a new interface PropertyTransformerComputeInterface to allow property transformers with supports, to compute a value that will be fixed during code generation.
  • GH#306 Support ObjectMapper attributes.
  • GH#306 Add an implementation for Symfony ObjectMapperInterface using AutoMapper.

Changed

  • [BC Break] GH#297 PropertyTransformerSupportInterface does not use a TypesMatching anymore, you can get the type directly from SourcePropertyMetadata or TargetPropertyMetadata.
  • [BC Break] GH#297 ProviderInterface::provide method now receive also the identifiers of the object to provide.

Fixed

  • GH#303 Fix api platform not returning an iri when there is no property mapped.

Miscellaneous

  • GH#297 Add a castor task to serve the symfony app in tests for debugging purpose.

9.5.0 - 2025-09-18

Added

  • GH#260 Add support for identifiers detection and comparison of objects, this allow mappers to detect if objects are equals based on some properties, which allow better deep merge / update of collections.
  • GH#253 Add support for Doctrine provider, which allow to fetch entities from database instead of creating new ones, this is an experimental feature.

Changed

  • GH#286 Optimize condition order to avoid unnecessary method calls by prioritizing custom conditions

Fixed

  • GH#280 Use correct property name to extract types from write mutator, which result in better extraction in some cases.
  • GH#272 Fixed circular references with promoted properties.
  • GH#285 Fix constructor not used when on a abstract class.

Miscellaneous

  • GH#281 Generate expected data for test with new line to please IDE.
  • GH#263 Add a regression test for nested array bug that occured and fixed between 9.2.1 and 9.4.1.
  • GH#288 Update php cs fixer to support PHP 8.4.

9.4.1 - 2025-06-03

Fixed

  • GH#278 Allow to set remove default property config in symfony bundle

9.4.0 - 2025-05-30

Added

  • GH#246 Add support for PHP 8.4
  • GH#246 Add support for API Platform 4
  • GH#252 Add support for SerializedName attributes
  • GH#251 Allow to map extra properties on array/object
  • GH#242 Add support for DiscriminatorMap with interface
  • GH#256 Allow nested array to be transformed to object
  • GH#262 Allow to extract types from getter
  • GH#261 Remove existing values when using adder and remover on collection

Changed

  • GH#243 GH#258 Clean the tests suite
  • GH#264 Upgrade phpstan to make it work with PHP 8.4
  • GH#257 Better error reporting of missing 'typePropery' when using DiscriminatorMap
  • GH#265 Set deep populate to true if passing an existing value
  • GH#266 Use composer to get installed versions instead of const

Fixed

  • GH#244 Avoid double CI run
  • GH#247 Update invalid syntax in configuration.md for constant
  • GH#255 Fix array and collection when using deep target populate
  • GH#274 Fix support for Symfony 7.3

9.3.1 - 2025-03-07

Fixed

  • GH#236 Fix null values being used in constructor arguments when not allowed

9.3.0 - 2025-03-07

Added

  • GH#223 Handle array to Doctrine Collection transformations
  • GH#225 Add mapCollection method to base interface
  • GH#200 Added skip_uninitialized_values context to skip non initialized properties
  • GH#200 Changed skip_null_values behavior to not handle initialized properties anymore
  • GH#230 Allow to map unknown array into object when it's nested
  • GH#235 Add possibility to use the NameConverterInterface from symfony 7.2

Removed

  • GH#200 Drop nikic/php-parser < 5.0 compatibility

Fixed

  • GH#231 Fix cases where constructor arguments were missing but not detected
  • GH#188 Correctly handle default constructor arguments when they are objects.
  • GH#234 Fix custom providers not being registered inside the bundle

Miscellaneous

  • GH#232 Use castor for local and CI checks on the library

9.2.1 - 2025-01-31

Fixed

  • GH#207 GH#208 Fix implicity nullable parameter deprecations
  • GH#212 Fix cases where class target has adder and remover AND constructor arguments

9.2.0 - 2024-11-19

Added

  • GH#180 Add configuration to generate code with strict types
  • GH#183 Ability to change reload strategy from AutoMapper::create()
  • GH#193 add icon to symfony profiler

Changed

  • GH#186 Optimize creation from constructor
  • GH#205 Add support for phpstan/phpdoc-parser 2

Fixed

  • GH#184 Fix error when mapping from stdClass to constructor with nullable/optional arguments
  • GH#185 Fix constructor with default parameter array does not work with constructor_arguments context
  • GH#187 Fix regression after GH#184
  • GH#192 Fix source and context not passed to callable transformer

9.1.2 - 2024-09-03

Fixed

  • GH#174 Fix race condition when writing generated mappers
  • GH#167 Fix property metadata attribute name in docs
  • GH#166 Remove cache for property info, use specific services instead

9.1.1 - 2024-06-19

Fixed

  • GH#164 Fix type extract with @param in constructor doc block

9.1.0 - 2024-06-06

Added

  • GH#153 Handle DateTime format in MapTo/MapFrom/Mapper attributes

Fixed

  • GH#158 Actually read reload_strategy from bundle configuration
  • GH#137 Always allow to write private props in constructor
  • GH#129 Use map_private_properties when configuring ReflectionExtractor

9.0.2 - 2024-05-23

Deprecated

  • GH#136 Deprecate the ability to inject AST transformer factories withing stand-alone AutoMapper

Fixed

  • GH#131 Require mandatory packages
  • GH#132 Use DI Extension class instead of deprecated HttpKernel Extension
  • GH#130 Make ClassDiscriminatorResolver optional
  • GH#135 Fix return type of AutoMapper::create()
  • GH#139 Fix unreachable variable in BuitinTransformer
  • GH#138 Declare CopyTransformerFactory as a service
  • GH#142 Make MapperMetadata non-internal because it is used within PropertyTransformerSupportInterface interface
  • GH#148 Handle deprecated class LNumber in nikic/php-parser v5
  • GH#151 Fix type in generated code

9.0.1 - 2024-05-10

Fixed

  • GH#124 Fix Symfony's WebProfiler issues
  • GH#125 Fix MetadataCollector default highlight colors

9.0.0 - 2024-05-06

Added

  • GH#114 Introducing Mapper Attribute
  • GH#117 Allow multiple source/target, allow overriding attribute with priority system

Changed

  • GH#119 Change serializer configuration naming in Symfony Bundle

Fixed

  • GH#109 Use AutoMapper exceptions
  • GH#115 Fix generating discriminator dependencies
  • GH#116 Fix property transformer with adder and remover methods

9.0.0-beta.2 - 2024-04-02

Added

  • GH#95 Add Api Platform integration
  • GH#103 Add debug command and profiler for the symfony bundle

Changed

  • GH#104 Replace allow_constructor with constructor_strategy to have more control on how to use the constructor
  • GH#102 Change default reload behavior for the symfony bundle

Fixed

  • GH#101 Fix some inconsistencies with symfony/serializer behavior

9.0.0-beta.1 - 2024-03-25

Added

  • GH#61 Add event system during code generation, make serializer optional thanks to it
  • GH#63 Merge bundle directly into automapper, will replace automapper-bundle
  • GH#59 Add MapTo & MapFrom attributes
  • GH#78 Add MapTo & MapFrom listeners to bundle
  • GH#80 Add if feature to MapTo / MapFrom attributes
  • GH#81 Allow MapTo / MapFrom attributes in class when declaring a transformer and a name
  • GH#82 Add groups to MapTo / MapFrom attributes
  • GH#84 Allow expression language for transformer and add provider for custom functions
  • GH#86 Bundle: Allow to use eval loader instead of file
  • GH#89 Add normalizer format in context, allow skipping group checking and remove registry interface from normalizer
  • GH#96 Add a way to instantiate the target object from external service using provider
  • GH#98 Allow normalizer to only work with registered mapping

Changed

  • GH#56 Refactor metadata
  • GH#68 Allow to use sf 5.4 for most things, remove useless deps / suggests
  • GH#71 Use interface for class metadata factory
  • GH#75 Types: better matching between types to better handle multiple types
  • GH#79 Refactor the way to create custom transformer
  • GH#90 Allow to run symfony app in tests

Fixed

  • GH#70 Split map to / map from, fix from array
  • GH#73 Don't map unexisting context, fix target to populate
  • GH#72 Don't map property if groups specified and no groups attached
  • GH#74 Check class exists when checking reflection class in object transformer factory
  • GH#77 Try to get types from read accessor / write mutator first
  • GH#83 Fix MapFrom: correctly use method from target if asked
  • GH#85 Fix mapping with proxies
  • GH#85 Fix \Traversable normalization
  • GH#85 Fix array fetching on string indexed array
  • GH#87 Correctly map from an inherited class
  • GH#93 Fix map to overriding ignore / groups attribute from serializer
  • GH#94 Fix most phpstan issues

Documentation

  • GH#91 Add documentation versioning
  • GH#88 Reorganize documentation structure
  • GH#92 Add doc about mapping
  • GH#98 Add migration guide into documentation

8.2.2 - 2024-03-19

Added

  • GH#54 Introduce MapperContext::DATETIME_FORCE_TIMEZONE

Fixed

  • GH#55 Remove most of deprecations in tests
  • GH#69 Allow to handle union types with several objects

Documentation

  • GH#64 Use poetry to run and build documentation

8.2.1 - 2024-03-11

Changed

  • GH#50 Support generator mapping
  • GH#36 Compatibility with nikic/php-parser v5

Fixed

  • GH#52 Don't tell we support internal php classes

8.2.0 - 2024-03-11

Added

  • GH#25 Pass full input object to property custom transformers
  • GH#10 Introduce custom transformers
  • GH#26 Fix mappings involving DateTimeInterface type
  • GH#37 Adds useful phpDoc annotation in generated mappers

Changed

  • GH#27 Use PhpStanExtractor instead of PhpDocExtractor
  • GH#35 Refactoring Mapper Generator
  • GH#47 Use directly the custom transformer instead of extracting it as a callback
  • GH#48 Change the way transformer factory are injected to make it work as soon as automapper is created

Fixed

  • GH#33 Allow usage of imported class names in custom transformers
  • GH#45 Fix composer.lock for phpstan and php-cs-fixer tooling
  • GH#44 Allow skipping uninitialized property when skipping null values

8.1.0 - 2023-12-14

Added

  • GH#22 Added generic AST extractor
  • GH#21 Add VERSION constants within AutoMapper class and use it for transformers hashes

Changed

  • GH#19 Use attributes everywhere instead of annotations
  • GH#18 Symfony 7 support

8.0.2 - 2023-11-06

Added

  • GH#11 Added phpstan level 5 in CI

Fixed

  • GH#9 fix: mapPrivatePropertiesAndMethod should not be mandatory
  • GH#15 fix: check class existence in SymfonyUidTransformerFactory

8.0.1 - 2023-10-04

Changed

  • GH#6 Document all AST code by explaining what it generates

Fixed

  • GH#7 Fix NullableTransformer should check if array key exists

[8.0.0] - 2023-09-26

Changed

  • Modernization, PHP 8.2 and typed properties everywhere
  • GH#1 Better private properties handling

Fixed

  • GH#753 Fix: AutoMapper should accept getters with default properties

[7.5.3] - 2023-08-04

Fixed

  • GH#742 Always require registry during cache warmup
  • GH#741 #[MapToContext] should accept virtual properties

[7.5.2] - 2023-07-10

Added

  • [AutoMapper] GH#733 Configure date format with context
  • [AutoMapper] GH#731 Introduce new attribute MapToContext

Fixed

  • [AutoMapper] GH#734 Cache warmer should generate mappers for nested classes

[7.5.1] - 2023-06-13

Fixed

  • [AutoMapper] GH#729 Allow to add full objects in allowed_attribute context

[7.5.0] - 2023-04-24

Changed

  • [AutoMapper] GH#720 Add mixed return type to generated mappers
  • [AutoMapper] GH#721 Create mappers on Symfony cache warmup

[7.4.4] - 2023-04-14

Added

  • [AutoMapper] GH#710 Add Enum support in AutoMapper bundle
  • [AutoMapper] GH#711 Allow nesting properties with MapperContext::isAllowedAttribute()
  • [AutoMapper] GH#713 Use serializer's "ignore" attribute
  • [AutoMapper] GH#714 Allow custom context in AutomapperNormalizer
  • [AutoMapper] GH#716 Add readonly properties support
  • [AutoMapper] GH#718 Disallow readonly target when using object to populate

[7.4.3] - 2023-03-23

Added

  • [AutoMapper] GH#707 Add Enum support

[7.2.4] - 2022-06-15

Fixed

  • [AutoMapper] GH#624 AutoMapper directory creation should be out of registry functions

[7.2.3] - 2022-06-15

Changed

  • [AutoMapper] GH#623 We don't need registry when not hot reloading

[7.2.2] - 2022-03-21

Fixed

  • [AutoMapper] GH#606 Lock file when writing in AutoMapper registry

[7.1.7] - 2022-02-03

Fixed

  • [AutoMapper] GH#594 Issue when no targetTypes in BuiltinTransformer

[7.1.6] - 2022-01-27

Fixed

  • [AutoMapper] GH#589 Fix setting properties when using target to populate object

[7.1.4] - 2021-12-16

Fixed

  • [AutoMapper] GH#567 Fixed MapperContext::withNewContext target_to_populate value

[7.1.3] - 2021-11-12

Changed

  • [AutoMapper] GH#564 Remove deprecations

Fixed

  • [AutoMapper] GH#567 Fix the value of target_to_populate on MapperContext::withNewContext call

[7.1.2] - 2021-10-18

Fixed

  • [AutoMapper] GH#560 Fix fail on generic object without explicit classname

[7.1.1] - 2021-10-08

Fixed

  • [AutoMapper] GH#553 Fix generated Mappers with adder calls

[7.1.0] - 2021-06-25

Added

  • [AutoMapper] GH#546 Add stdClass to stdClass transformation support

Changed

  • [AutoMapper] GH#536 Update benchmark scripts

[7.0.0] - 2021-05-19

Added

  • [AutoMapper] GH#462 Move bundle out of the component
  • [AutoMapper] GH#433 Handle dictionaries with ArrayTransformer
  • [AutoMapper] GH#432 Ignore API Platform resources when using AutoMapper normalizer
  • [AutoMapper] GH#495 Add Symfony Uid transformers #495
  • [AutoMapper] GH#507 Add skip_null_values feature

Changed

  • [AutoMapper] GH#458 Add PrioritizedTransformerFactoryInterface and implementation
  • [AutoMapper] GH#459 Add DependentTransformerInterface and implementation
  • [AutoMapper] GH#460 Add AssignedByReferenceTransformerInterface and implementation

Fixed

  • [AutoMapper] GH#461 Transformer arguments typo
  • [AutoMapper] GH#487 Can not call getName when type is adders/removers

[6.3.3] - 2021-02-10

Changed

  • [AutoMapper] GH#498 Improve FileLoader: do not use registry at all when hot reload is disabled.
  • [AutoMapper] GH#498 When using bundle: automatically disable hot reload when not in debug mode.

[6.3.2] - 2020-12-23

Changed

  • [AutoMapper] GH#465 Allow dateTimeFormat customisation when initialising

[6.3.0] - 2020-11-22

Added

  • [AutoMapper] GH#443 Add configuration to use custom NameConverter
  • [AutoMapper] GH#446 Add autoconfigure on TransformerFactoryInterface
  • [AutoMapper] GH#453 Introducing autoregistering of custom Mapper configuration

Changed

  • [AutoMapper] GH#431 Add a second parameter to forMember with target object
  • [AutoMapper] GH#452 Improve ClassLoaderInterface service definition

[6.2.5] - 2020-11-18

Fixed

  • [AutoMapper] GH#426 Fix mapping for empty collection value on an array property

[6.2.0] - 2020-09-09

Added

  • [AutoMapper] GH#397 Update AutoMapper to be able to bind custom TransformerFactory

Changed

  • [AutoMapper] GH#403 Allow ^5.0 for phpdocumentor/reflection-docblock

Fixed

  • [AutoMapper] GH#396 Typo in DateTime transformer

[6.1.0] - 2020-08-20

Changed

  • [AutoMapper] GH#306 AutoMapper update

Fixed

  • [AutoMapper] GH#354 Do not try to create an instance of an interface
  • [AutoMapper] GH#353 Allow date_time_format override from bundle
  • [AutoMapper] GH#372 Use copy transformer for sibling arrays

[5.3.0] - 2020-01-15

Added

  • [AutoMapper] GH#214 Added a quick documentation about the AutoMapper

[5.2.1] - 2019-11-25

Fixed

  • [AutoMapper] GH#179 Fixing incompatible changes in Symfony 5.0