ZF-3779: Zend_Locale : some methods accept object or string and are not properly coded
Description
Zend_Locale's constructor docblock says
@param string $locale (Optional) Locale for parsing input
The constructor looks for a string, but also looks for a Zend_Locale object to call its toString() method. The docblock should reflect that fact.
Same (revert) for the setDefault() method, docblock says
@param string|Zend_Locale $locale Locale to set
But this time, the method doesn't accept a Zend_Locale object as param, it should ( calling its toString() method).
Comments
Posted by Thomas Weidner (thomas) on 2008-07-28T09:36:05.000+0000
Just because the Docblock is wrong, you can not say that the complete class is coded wrong :-) I think this is a hard word ;-)
Related to your second example you are wrong. Looking at the code you can see that the locale is casted to a string which does exactly the same as calling toString but is a little more performant.
I will correct the docblock.
Posted by julien PAULI (doctorrock83) on 2008-07-28T09:48:11.000+0000
I did not say the complete class is wrong, perhaps my english sentence meant that, so I apologyze :-D
For my second example, I'm sorry I'm right, I'm really talking about setDefault() method, not the setLocale() method ( whitch effectively casts to string like you say )
Posted by Thomas Weidner (thomas) on 2008-07-28T11:47:43.000+0000
Fixed with r10510
Posted by Wil Sinclair (wil) on 2008-09-02T10:39:07.000+0000
Updating for the 1.6.0 release.