Merge "Have SquidUpdate::newFromTitles use getSquidURLs"
[lhc/web/wiklou.git] / tests / phpunit / includes / api / RandomImageGenerator.php
index e3eea4c..e27ba1c 100644 (file)
@@ -256,7 +256,8 @@ class RandomImageGenerator {
                        $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() );
@@ -328,7 +329,7 @@ class RandomImageGenerator {
         * 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();
@@ -365,8 +366,8 @@ class RandomImageGenerator {
        /**
         * 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 ) {
@@ -432,7 +433,7 @@ class RandomImageGenerator {
         * 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 );
@@ -451,7 +452,7 @@ class RandomImageGenerator {
         *
         * 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