If $source is an object and already is of type $targetType, we do return the unmodified object.
public convert ( mixed $source, string $targetType, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : mixed | ||
$source | mixed | the source data to map. MUST be a simple type, NO object allowed! |
$targetType | string | The type of the target; can be either a class name or a simple type. |
$configuration | Neos\Flow\Property\PropertyMappingConfigurationInterface | Configuration for the property mapping. If NULL, the PropertyMappingConfigurationBuilder will create a default configuration. |
return | mixed | an instance of $targetType |