Provide random word from dictionary
Definition at line 11 of file Dictionary.php.
◆ __construct()
__construct |
( |
|
$dictionaryFilePath | ) |
|
- Parameters
-
string | $dictionaryFilePath | |
- Exceptions
-
Definition at line 27 of file Dictionary.php.
29 $this->dictionaryFilePath = $dictionaryFilePath;
◆ getRandWord()
Returns random word from dictionary
- Returns
- string
Definition at line 37 of file Dictionary.php.
39 if ($this->dictionary ===
null) {
40 $this->readDictionary();
43 $randIndex = random_int(0, count($this->dictionary) - 1);
44 return trim($this->dictionary[$randIndex]);
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/setup/src/Magento/Setup/Model/Dictionary.php