[PEPr] Comment on Validate::Validate_IT

From: Date: Sat, 23 Feb 2008 16:49:36 +0000
Subject: [PEPr] Comment on Validate::Validate_IT
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-49185@lists.php.net to get a copy of this message
Philippe Jausions (http://pear.php.net/user/jausions) has commented on the proposal for Validate::Validate_IT. Comment: You don't need to submit a proposal for a sub-package of Validate. Contact the leads of the Validate package to get it in there. That been said: - For consistency with other Validate_* packages, rename the regionCode() method to region(). And region() to regionName(). Although the full name of the regions would be more appropriate in the I18Nv2 package instead. - I would suggest the same for city methods, but we don't currently have any standard way to do that across all countries Validate_* packages. Again city names are more related to I18N than validate itself. - Why do 2 preg_match() calls in the fiscalCode() method? Just return the cast to (boolean) of the result of the 2nd preg_match(): return (bool)preg_match('/' . '([A-Z]+){6}' . '([0-9]+){2}([A-Z]+){1}([0-9]+){2}' . '([A-Z]+){1}([0-9]+){3}([A-Z]+){1}' . '/', $code); - The 3 different lines to do trim(), replace(), and strtolower() should be wrapped into one liner for concision: $code = str_replace(' ', '', strtolower(trim($code))); - Run your code through PHP_CodeSniffer to fix PEAR coding standard issues. Proposal information: http://pear.php.net/pepr/pepr-proposal-show.php?id=532 -- Sent by PEPr, the automatic proposal system at http://pear.php.net

« previous php.pear.dev (#49185) next »