Re: I18Nv2

From: Date: Mon, 08 Mar 2004 10:57:12 +0000
Subject: Re: I18Nv2
References: 1  Groups: php.pear.qa 
Request: Send a blank email to pear-qa+get-864@lists.php.net to get a copy of this message
On 6 Mar 2004 at 15:45, Michael Wallner wrote: > I18Nv2 would be ready for its first release, so I would > like to check it in and fire the release. Could someone > spend some time and check the karma thingy - if nobody objects. Hi Mike, now that you announced the package is ready, I think you might be glad to have others take a look at the source? Just take this mail as friendly suggestions, not as a "must do it this way". a) in Country.php: imho you should move the initialisation of _codes from the constructor directly into the class identifier or even into a define() since I assume they won't be changed. b) in Country.php, function getName(): imho the use of @ to silence an error for a non-existant array-entry is "not that clean". I'd go for a isset-check first ... c) in I18Nv2.php, function setLocale(): the @access-tag is only used for public/private (maybe also protected). But there is a @static-tag for the thing you'd like to express. If you have problems during peardoc-generation with the @static-tag, grab a copy of the latest template for phpDocumentor from Greg's CVS. The @static-tag has been fixed recently for peardoc. d) in I18Nv2.php, functions setLocale/lastLocale(): Maybe make the functions behave similar like the php-functions? From the doc of setLocale: If locale is NULL or "0", the locale setting is not affected, only the current setting is returned. e) in I18Nv2.php, functions lastLocale() and others: Is the use of getStaticProperty really necessary? Why not access them directly, where needed, in your functions? f) in I18Nv2.php, function getInfo(): Not tested, but could there possibly a problem with $part? What if it's 0 because I want the first part? I guess 0 would also evaluate to false. Maybe use isset in your conditional statement to make clear what you expect it to behave like. g) class I18Nv2_Locale: Are your variables public or private? If private, please prefix those with _. Otherwise please give some phpdoc-comments what these vars (will) contain or are allowed to contain. h) in Locale.php, function setCurrencyFormat(): Again, I think we once stated that @-calls should be avoided where possible. Maybe avoid? But this is up to you - and maybe others will think differently about this ... in such cases. i) in Locale.php, functions time()/date(): Maybe you should also use a default of null in your parameters and use a isset() here in the conditional statement? What if somebody wants to format 0:00 o' clock? k) in Negotiator.php, right before function __construct(): Where the two // left there intentionally? :-)) General remark: Maybe it would be a good idea to avoid the examples at the beginning of your class-files and put them into the docs/examples-directory? This is the appropriate place for them and you can also include them in phpDocumentor afaik. Others, please also give some comments ... Regards, Stefan

« previous php.pear.qa (#864) next »