Task #33801

Add a "mixed" type converter

Added by Ondrej Hatala over 3 years ago. Updated about 1 year ago.

Status:Rejected Start date:2012-02-09
Priority:Could have Due date:
Assigned To:Bastian Waidelich % Done:

0%

Category:Property
Target version:-
Sprint: Has patch:No
PHP Version: Complexity:

Description

Problem:
"mixed" is used as a default type in case you don't explicitly provide proper type but there is no such converter, resulting in ambiguous behaviour.

Example:
When you create a command with a parameter in CommandController, and don't provide it's type properly by the @param annotation, "mixed" is determined as a default. When trying to use this command, you will get an Exception with message "Exception while property mapping at property path "":Could not find a suitable type converter for "mixed" because no such class or interface exists."

Suggested solution:
Create a "mixed" type converter that would be essentially NOP, thus making your code work the way you expect it to.

History

#1 Updated by Bastian Waidelich over 1 year ago

  • Status changed from New to Needs Feedback

IMO a MixedTypeConverter defeats the goal of the converters.. It would be better to specify the right type - or use simple types if you don't care about conversion..
Obviously anyone is free to write a no-op TypeConverter and use it in their apps, but in my opinion this should not be part of the distribution.
Do you agree?

#2 Updated by Bastian Waidelich about 1 year ago

  • Status changed from Needs Feedback to Rejected
  • Assigned To set to Bastian Waidelich

Closing due to missing feedback. Feel free to comment and/or re-open if you don't agree

Also available in: Atom PDF