Req #13007 [Opn]: No hardcoding of country names
| From: | pear dot neufeind at speedpartner dot de | Date: | Tue, 29 Sep 2009 00:29:28 +0000 |
| Subject: | Req #13007 [Opn]: No hardcoding of country names | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-1758@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=13007&edit=1
ID: 13007
Updated by: pear.neufeind@speedpartner.de
Reported By: pear at 11abacus dot com
Summary: No hardcoding of country names
Status: Open
Type: Feature/Change Request
Package: Validate_Finance
Operating System: Irrelevant
-Package Version: 0.5.4
+Package Version: 0.5.5
PHP Version: Irrelevant
Roadmap Versions:
New Comment:
-Package Version: 0.5.4
+Package Version: 0.5.5
For the moment adding some code-improvements from kguest's patch.
I'll want to discuss the "long-lines" codingstyle-things with him
though.
About the country-codes: Haven't yet made a final decision on that. You
are right that I18Nv2_Country might be a good idea - but using that
inside the lib now would add an "unneeded" dependency. And removing it
altogether would "needlessly" break BC (although the package is alpha, I
know). But maybe we can discuss that part in more detail via email,
Philippe, if you agree?
For the moment I'll leave the bug open to track your yet unfullfilled
suggestion to use I18Nv2_Country.
Previous Comments:
------------------------------------------------------------------------
[2008-10-03 19:17:45] kguest
added a patch for the Coding Standards issues.
I would imagine the reason why I18Nv2_Country isn't being used, is that
not every country has/supports IBAN values; having a distinct array here
rather than reusing I18Nv2_Country is probably in part to prevent false
positives from being detected; ie prevents a fake IBAN value from being
determined to be valid.
------------------------------------------------------------------------
[2008-01-30 13:10:53] jausions
Description:
------------
IMO having the country names hardcoded in Validate_Finance_IBAN is not
good practice. The user should instead be advised to use I18Nv2_Country
instead.
Related to that, why not $_iban_countrycode_countryname populate the
array directly on the static declaration in
_getCountrycodeCountryname(), the isset() section is too much. This
method is to basically create a class static property. In the same vein,
why again making it static in validate, there's not much to gain, just
clutters the code.
Also some minor PEAR CS, such as missing spaces around = signs, or
after some , commas.
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=13007&edit=1