芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/store.kwesioben.com/vendor/psy/psysh/src/Readline/Hoa/AutocompleterWord.php
setWords($words); } /** * Complete a word. * Returns null for no word, a full-word or an array of full-words. * * @param string &$prefix Prefix to autocomplete * * @return mixed */ public function complete(&$prefix) { $out = []; $length = \mb_strlen($prefix); foreach ($this->getWords() as $word) { if (\mb_substr($word, 0, $length) === $prefix) { $out[] = $word; } } if (empty($out)) { return null; } if (1 === \count($out)) { return $out[0]; } return $out; } /** * Get definition of a word. */ public function getWordDefinition(): string { return '\b\w+'; } /** * Set list of words. * * @param array $words words * * @return array */ public function setWords(array $words) { $old = $this->_words; $this->_words = $words; return $old; } /** * Get list of words. */ public function getWords(): array { return $this->_words; } }