| 1 | <?php |
||
| 8 | class StoredWordSelector implements WordSelector |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var WordRepository |
||
| 12 | */ |
||
| 13 | private $wordRepository; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Constructor |
||
| 17 | * |
||
| 18 | * @param WordRepository $wordRepository |
||
| 19 | */ |
||
| 20 | 6 | public function __construct(WordRepository $wordRepository) |
|
| 24 | |||
| 25 | /** |
||
| 26 | * Gets a random word of <length> characters for the <lang> language |
||
| 27 | * <lang> must be an iso2 code in lower case |
||
| 28 | * |
||
| 29 | * @param int $length |
||
| 30 | * @param string $lang |
||
| 31 | * @param float $complexity |
||
| 32 | * |
||
| 33 | * @throws \InvalidArgumentException |
||
| 34 | * |
||
| 35 | * @return Word |
||
| 36 | */ |
||
| 37 | 6 | public function getRandomWord($length, $lang = 'en', $complexity = null) |
|
| 47 | } |
||
| 48 |