Silently drop unknown titles in completion search
[lhc/web/wiklou.git] / tests / phpunit / includes / api / RandomImageGenerator.php
index d5c17ee..7fd5f1d 100644 (file)
@@ -87,7 +87,7 @@ class RandomImageGenerator {
                                        __DIR__ . '/words.txt'
                                ] as $dictionaryFile
                        ) {
-                               if ( is_file( $dictionaryFile ) and is_readable( $dictionaryFile ) ) {
+                               if ( is_file( $dictionaryFile ) && is_readable( $dictionaryFile ) ) {
                                        $this->dictionaryFile = $dictionaryFile;
                                        break;
                                }
@@ -187,7 +187,7 @@ class RandomImageGenerator {
                $spec['height'] = mt_rand( $this->minHeight, $this->maxHeight );
                $spec['fill'] = $this->getRandomColor();
 
-               $diagonalLength = sqrt( pow( $spec['width'], 2 ) + pow( $spec['height'], 2 ) );
+               $diagonalLength = sqrt( $spec['width'] ** 2 + $spec['height'] ** 2 );
 
                $draws = [];
                for ( $i = 0; $i <= $this->shapesToDraw; $i++ ) {