Re: Raising errors inside a constructor
| From: | Joshua Eichorn | Date: | Tue, 17 Aug 2004 14:04:43 +0000 |
| Subject: | Re: Raising errors inside a constructor | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-32741@lists.php.net to get a copy of this message | ||
Olivier Guilyardi wrote:
Thank you for helping me understand that :) I must say all of these static calls on the ErrorStack introduction page confused me. Now, ErrorStack seems indeed powerful. I guess it's not too hard to make a base class that uses ErrorStack. Then I'd subclass it to be able to do the much more clearer : if ($berry->hasError()) , instead of this PEAR_ErrorStack::staticHasErrors('berry') thing that will confuse 90% of the people who read my code. Generally using base classes is a bad idea (well in php, something like java is a bit different), especially to get rid of static calls which are very readable just a little different if you've never seen them before.-josh