Daniel O'Connor | 4 Sep 07:57 2009
Picon

[PEPr] Comment on Images::Image_Diff


Is there any compelling reason to make these static methods?

Being static means I can't mock them out, and makes them more like
namespaced functions than an Image_Diffing object.

Ie:

Image_Diff::nearlySame()

could easily be

$diff = new Image_Diff();

$diff->nearlySame();

while having none of the drawbacks of statics
(http://misko.hevery.com/code-reviewers-guide/flaw-brittle-global-state-singletons/)

-- 
http://pear.php.net/pepr/pepr-proposal-show.php?id=611

--

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Gmane