[PEPr] Comment on PHP::PGraph
| From: | Till Klampaeckel | Date: | Tue, 19 Feb 2013 15:18:55 +0000 |
| Subject: | [PEPr] Comment on PHP::PGraph | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-55173@lists.php.net to get a copy of this message | ||
This looks interesting. And it's an impressive piece of work!
A few comments (just browsed through the code briefly):
* add some examples
* find a common "namespace" and stack all classes into it â since you
mention PHP 5.3, why not go all the way with proper namespaces and move
this code into pear2? (http://pear2.php.net)
* avoid global constants with define() â e.g. use class constants if
possible
* I read somewhere that PEAR is only required when you install through it,
but there is a
require_once "PEAR.php"; in PGraph.php. if you get rid off
this, that would be great.
* maybe add a composer.json for flexibility
* check if private is really necessary or if you could do with
protected to make extending your code easier
* you can simplify many of these:
https://github.com/Willux/PGraph/blob/master/src/PGraph.php#L630-L634
* strip require_once calls and rely on autoload â either provide one or
let the user decide what they want to do.
--
http://pear.php.net/pepr/pepr-proposal-show.php?id=690