Task #33801

Add a "mixed" type converter

Added by Ondrej Hatala almost 8 years ago. Updated over 5 years ago.

Status:
Rejected
Priority:
Could have
Category:
Property
Target version:
-
Start date:
2012-02-09
Due date:
% Done:

0%

Sprint:
PHP Version:
Has patch:
No
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 almost 6 years 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 over 5 years ago

  • Status changed from Needs Feedback to Rejected
  • Assignee 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