$shape->addAttribute( 'points', self::shapePointsToString( $drawSpec['shape'] ) );
}
- if ( !$fh = fopen( $filename, 'w' ) ) {
+ $fh = fopen( $filename, 'w' );
+ if ( !$fh ) {
throw new Exception( "couldn't open $filename for writing" );
}
fwrite( $fh, $svg->asXML() );
* This is used when simulating a rotated image capture with Exif orientation
* @param array $spec Returned by getImageSpec
* @param array $matrix 2x2 transformation matrix
- * @return array transformed Spec
+ * @return array Transformed Spec
*/
private static function rotateImageSpec( &$spec, $matrix ) {
$tSpec = array();
/**
* Given a matrix and a pair of images, return new position
* @param array $matrix 2x2 rotation matrix
- * @param int $x x-coordinate number
- * @param int $y y-coordinate number
+ * @param int $x The x-coordinate number
+ * @param int $y The y-coordinate number
* @return array Transformed with properties x, y
*/
private static function matrixMultiply2x2( $matrix, $x, $y ) {
* array( array( 'foo', 'bar' ), array( 'quux', 'baz' ) );
*
* @param int $number Number of pairs
- * @return array two-element arrays
+ * @return array Two-element arrays
*/
private function getRandomWordPairs( $number ) {
$lines = $this->getRandomLines( $number * 2 );
*
* Will throw exception if the file could not be read or if it had fewer lines than requested.
*
- * @param int $number_desired number of lines desired
+ * @param int $number_desired Number of lines desired
*
* @throws Exception
* @return array Array of exactly n elements, drawn randomly from lines the file