On Wed, 2007-09-19 at 15:26 +0200, Derick Rethans wrote:
> On Wed, 19 Sep 2007, Kore Nordmann wrote:
> 
> > While writing a public static method I came across a problem. Options or
> > class properties are not available, because we don't have a option
> > object accessible in the class, so I ended up with a quite huge amount
> > of optional parameters for my method:
> > 
> > static public function copyRecursive( $source, $destination, $depth =
> > -1, $followSymlinks = false, $dirMode = 0775, $fileMode = 0644 )
> > 
> > Frederik told me, that he had the same problem some time ago, so I
> > thought, that it is the right time to discuss it with you...
> 
> And we already have a documented solution:
> http://ez.no/ezcomponents/contributing/coding_standards#id48

Hmm, then sorry for the noise. I should know our own coding standards
better ;).

Even this solution is not optimal from my pov, but it has probably been
discussed before, without me noticing it...

a) You don't have any default values - who enforces setting the options
array before you call the static method? So you may have to maintain the
default values in two places, or throw an exception when the options
weren't set before.

b) (minor) You can only set a complete option class and no single
options.

-- 
Mit freundlichen Grüßen / Med vennlig hilsen
 
Kore Nordmann (GPG: 0xDDC70BBB)
eZ Components Developer
eZ systems Headquaters

tel +49 (0) 231-9742-7750 | fax +49 (0) 231-9742-7751
[EMAIL PROTECTED] | eZ systems | ez.no

Attachment: signature.asc
Description: This is a digitally signed message part

-- 
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components

Reply via email to