__DIR__ . '/words.txt'
] as $dictionaryFile
) {
- if ( is_file( $dictionaryFile ) and is_readable( $dictionaryFile ) ) {
+ if ( is_file( $dictionaryFile ) && is_readable( $dictionaryFile ) ) {
$this->dictionaryFile = $dictionaryFile;
break;
}
}
/**
- * Given array( array('x' => 10, 'y' => 20), array( 'x' => 30, y=> 5 ) )
+ * Given [ [ 'x' => 10, 'y' => 20 ], [ 'x' => 30, y=> 5 ] ]
* returns "10,20 30,5"
* Useful for SVG and imagemagick command line arguments
* @param array $shape Array of arrays, each array containing x & y keys mapped to numeric values
$points[] = $point['x'] . ',' . $point['y'];
}
- return join( " ", $points );
+ return implode( " ", $points );
}
/**
$components[] = mt_rand( 0, 255 );
}
- return 'rgb(' . join( ', ', $components ) . ')';
+ return 'rgb(' . implode( ', ', $components ) . ')';
}
/**
* Get an array of random pairs of random words, like
- * array( array( 'foo', 'bar' ), array( 'quux', 'baz' ) );
+ * [ [ 'foo', 'bar' ], [ 'quux', 'baz' ] ];
*
* @param int $number Number of pairs
* @return array Two-element arrays