Skip to content

Fix a lot of incorrect behaviors#347

Merged
joelwurtz merged 28 commits into
mainfrom
fix/review-findings
Jul 21, 2026
Merged

Fix a lot of incorrect behaviors#347
joelwurtz merged 28 commits into
mainfrom
fix/review-findings

Conversation

@joelwurtz

Copy link
Copy Markdown
Member

Fixed

  • Use the MapFrom attribute reference instead of MapTo when resolving transformers in MapFromListener
  • Do not run a transformation on a null source value when the target is not nullable, a TypeError is thrown for typed properties instead of the transformation crashing on the null value
  • Create backed enum from scalar source value instead of assigning the raw scalar
  • Convert between different backed enums through their backing value instead of copying the source instance
  • Normalize leading backslash in class names resolved from docblocks, fixing a parse error in generated mappers for global namespace classes and the __PM__ proxy name off-by-one
  • Implement CheckTypeInterface on enum, date-time and uid transformers so union source types generate a runtime check for every branch
  • Unwrap nullable doctrine collection target type, items are mapped to the collection value type instead of plain arrays
  • Capture the context in the isAllowedAttribute closure, fixing MapToContext combined with skip_null_values
  • Guard nested property accessors (parent.child) against null or uninitialized parent values on read, write and constructor paths, support private nested leaf properties and nullable parent types
  • Support variadic constructor parameters, values are spread as individual arguments and an absent variadic no longer throws MissingConstructorArgumentsException
  • The highest priority Mapper attribute wins as documented, instead of the lowest
  • Correct identifier hashing: scalar identifiers are cast to string, object identifiers are hashed through their own mapper and hash_final no longer receives a string as its boolean argument, fixing mappers generated with strictTypes: true
  • Atomic mapper file writes and locked registry updates in FileLoader, fixing partially written files and lost registry entries under concurrency, the cache warmer no longer discards previously registered mapper hashes
  • Initialize LazyMap only once instead of re-running the mapping on every access
  • Align Map attribute if condition semantics with symfony/object-mapper: if: false never maps the property, callables receive the value first and class level Map targets also match child classes
  • Do not register the cache warmer when the eval loader is enabled, fixing container compilation with automapper.loader.eval: true
  • Detect doctrine entities even when their metadata is not loaded yet, fixing missing provider and identifier on cold metadata factories
  • Do not map static properties

joelwurtz added 28 commits July 17, 2026 14:15
@joelwurtz
joelwurtz merged commit 639994a into main Jul 21, 2026
5 checks passed
@joelwurtz
joelwurtz deleted the fix/review-findings branch July 21, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant