» Details |
---|
|
» Comment |
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 |