[PEPr] +1 for Images::XBM
| From: | Philippe Jausions | Date: | Wed, 02 Mar 2005 15:33:54 +0000 |
| Subject: | [PEPr] +1 for Images::XBM | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-36464@lists.php.net to get a copy of this message | ||
Philippe Jausions (http://pear.php.net/user/jausions) has voted +1 on the proposal for Images::XBM.
Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=216
Vote information:
http://pear.php.net/pepr/pepr-vote-show.php?id=216&handle=jausions
This vote is conditional. The condition is:
Sorry for the late comments:
- Most methods name start with "image". I would recommend to drop that. It just take
longer to type.
- Some method name change recommendation
+ imageSX -> getWidth
+ imageSY -> getHeight
+ imageLine -> drawLine (and the like drawRectangle, drawEllipse...)
+ imageSetPixel -> setPixel (or drawPixel for consistency)
+ imageColorAt -> getColorAt
+ imageXBM -> output
+ imageCreateFromXBM -> createFromFile
- As Alan already commented:
+ "if" block needs {}
+ Constants needs to be IMAGE_XBM_*
- Constructor cannot return()
- In imageFigletText, if ratio is expected to be a number or "X:Y" format, no need of
preg_split(/[:x]/), just explode(':')
- _hexdec is not needed. 0xAF is already a standard PHP number. Just use hexdec() instead.
- In imageCreateFromXBM the file resource doesn't seem to be closed in successful flow.
- Add some spaces around all operators (+, =, /, *, <<...)
- Return the result of _ellipse directly instead of calling the method then "return
true". It saves a return statement.
- @access should be after @return in docBlock comments.
- PEAR CS: Opening curly braces "{" for function declaration goes to following line.
- Small optimization: in "for" loops, use pre-incrementation: ++$x instead of $x++
- The save to file method doesn't seem to handle failure to open file for writing (method
always returns true.)
-Philippe
--
Sent by PEPr, the automatic proposal system at http://pear.php.net