Re: Text_PathNavigator overhaul
| From: | Martin Jansen | Date: | Wed, 02 Sep 2009 08:47:11 +0000 |
| Subject: | Re: Text_PathNavigator overhaul | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-52752@lists.php.net to get a copy of this message | ||
Denny Shimkoski wrote:
> I went in to patch an ancient bug in Text_PathNavigator and was
> horrified by the code I saw there, so I rewrote the class for PHP 5.
>
> Source is here --
> http://bytebrite.com/demos/pathnav/PathNavigator.phps
>
> Interface exercised here --
> http://bytebrite.com/demos/pathnav/PathNavigatorTest.phps
>
> Open to any suggestions for improvement.
Most methods are lacking their visibility keywords (public, private,
protected).
Regarding normalizePath() I would probably refrain from a regular
expression and go with string functions instead. When throwing
exceptions, I believe that PEAR packages are expected to use their own
subclasses of the built-in Exception class.
Finally, a few line breaks would really improve the readability of the code.
Martin