« Previous | Next » 

Revision a7520579


Added by Bastian Waidelich over 7 years ago

[!!!][TASK] Don't cut off element type in PropertyMapper

Before a TypeConverter is used, the PropertyMapper calls a method
``canConvertFrom()`` on it with the current source and the expected
target type.

Previously a possible element type was cut off from the target type
before, so for a target type of "SomeType<SomeElementType>" only the
string "SomeType" was passed to ``canConvertFrom()``.
This makes it impossible to create a TypeConverter for a collection
type of a specific element type.

This is a breaking change if you created a custom TypeConverter for
a collection type (such as ``array``, ``SplObjectStorage``,
``ArrayObject`` or one of its subtypes), implemented the
``canConvertFrom()`` method and expected the second parameter to be
the truncated target type.
In this case simply add a line::

$targetType = TypeHandling::truncateElementType($targetType);

to the beginning of the method body.

Change-Id: I5859f4494beeb7fb86dd82a47b15172d849e252e
Related: #58696
Releases: master

  • added
  • modified
  • copied
  • renamed
  • deleted