Re: cvs: pear /Validate Validate.php package.xml package_ISPN.xml /Validate/Validate ISPN.php /Validate/tests issn.php product_numbers.php

From: Date: Fri, 21 Jan 2005 02:53:47 +0000
Subject: Re: cvs: pear /Validate Validate.php package.xml package_ISPN.xml /Validate/Validate ISPN.php /Validate/tests issn.php product_numbers.php
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-35660@lists.php.net to get a copy of this message
On Fri, 2005-01-21 at 02:26, Helgi Þormar wrote: > Hi Dan, > > > Recommend you look at the code and also look at the links given on each > > function, I didn't tho write this, only looked briefly on those web > > pages to understand a little better what I was writing tests for, but > > yes you are right, SSCC and all those EAN UCC functions are the same > > except for that one thing, and I could make a abstraction function which > > takes in the input, does the replacing, checks the length, does static > > on the right array (well I'd just have X long array and cut it down > > after needs), but well I'll see about if I'll do that before the release > > tomorrow. > > > > Thanks for the heads up, hadn't been paying much attention to that part > > of the Validate class :) > > I just had a go at this, was of course piece of cake, or well so I > thought, but I had major issues with the static thing, seems that it of > course will collide if I just name it all the same, thus it has to be > named differently for each method, and then I got this brilliant idea of > using variable variables (http://www.php.net/variables.variable for > those that don't know what I mean), there's where static gave me a huge > headache, it just didn't allow things to work anymore :/ > > I'll take another stab at this tomorrow and see if this static stuff is > really needed at all by the functions that do all the math. Well I somewhat solved it, I'll just keep the static part and have array_slice commented out for now, so now each function is 2 lines (UCC EAN and SSCC funcs I mean), and _process does all the work for them, which reminds me, can anyone think of a better name, IMHO the name I choose is kinda too general, even tho it's private function. I also emailed the original author about this static mess and am gonna see what he says about this :-) - Helgi

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