[dev] Re: [cvs] commit: whups/lib Admin.php Create.php

Marko Djukic marko at oblo.com
Thu Mar 27 05:37:19 PST 2003


Quoting Chuck Hagenbuch <chuck at horde.org>:

> Quoting Marko Djukic <marko at oblo.com>:
> 
> > a couple of points came up whilst fixing these files...
> > - maybe it could be useful having a setParams() type call (similar to
> > setDefault()) to set up the params after an addVariable()?
> 
> I dunno. Maybe it would; can you say where/why/how?
it's minor, style/readability i suppose - places where the addVariable() call
ends up running on several lines, with array(array( type constructs for the
params parameter.

> > - would it be useful to having a setInvalidCondition() function as part
> > of the variable class, which would have the variable set to invalid type
> > based on a certain condition? something like:
> >   $somevar = &$this->addVariable(..........);
> >   $somevar->setInvalidCondition($foo < $bar, _("not enough foo"));
> > could cut out quite a bit of code/complexity when setting up... but not
> > sure if it would do anything about overhead? or maybe some other similar
> > solution...
> 
> As far as I can tell it would *add* a lot of overhead, and I don't see that
> it removes *that* much code.
ok, wasn't sure. just thinking if there could be a way to clean up the multitude
of if() statements setting either an 'enum' or an 'invalid' variable type.

marko


More information about the dev mailing list