Re: please vote - package-proposal Payment_IBAN
| From: | Greg Beaver | Date: | Wed, 06 Aug 2003 20:41:02 +0000 |
| Subject: | Re: please vote - package-proposal Payment_IBAN | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-19343@lists.php.net to get a copy of this message | ||
Hi Stefan,
I noticed a small bug in Payment_IBAN_Error's constructor, it calls Payment_IBAN_Error::errorMessage($code) instead of Payment_IBAN::errorMessage().
This is really clean code. It's nice to see such easy-to-read-and-use writing :).
A quick look at the source code for Validate shows that if you were to rewrite the IBAN class to use static methods (and just pass in an IBAN at the top), it would work perfectly with the Validate::multiple() method.
Alternatively, a method could (should) be added to Validate that allows the integration of non-static classes (which would be a very good idea for more complex validation). Any thoughts Tomas/Pierre?
In fact, why not just put Validate_IBAN in the Validate directory and add in a new static function for use with the Validate class? This way, users could use it with Validate, and also instantiate the Validate_IBAN class separately, if they need extended stuff.
If you'd like to implement another class that uses Validate_IBAN to do money transfers, I think that would make sense to call it Payment_IBAN. I wouldn't recommend integrating both into one class except for a custom solution outside of PEAR.
Greg
Stefan Neufeind wrote:
On 6 Aug 2003 at 12:51, Joshua Eichorn wrote:Unless you can actually use the class to move funds around i don't think it belongs in Payment -joshI've had a look at Validate just now. And I can't see how the IBAN- class could be integrated "easily" into Validate. Most functions I see there are quite small / easy - and even though some are "a bit longer" they still fit into just one function without the needs of any lookup-tables, helper-functions etc. So how do you think we could arrange this? One thing I thought about (a compromise?): - open a real branch "Validate" - make current class "Validate" be "Validate_Common" or "Validate_Misc" - and then add "Validate_IBAN" - if you really think because of it's main intention this should go under Validate. What do you think about that solution? Maybe even more interesting: What do those Validate-maintainers propose? Stefan