-
Bug
-
Resolution: Fixed
-
Minor
-
3.3.11
-
None
In:
The function: get_context() is described as:
/**
|
* Generates a text with approx. the specified length which contains the specified words and their context
|
*
|
* @param string $text The full text from which context shall be extracted
|
* @param string $words An array of words which should be contained in the result, has to be a valid part of a PCRE pattern (escape with preg_quote!)
|
* @param int $length The desired length of the resulting text, however the result might be shorter or longer than this value
|
*
|
* @return string Context of the specified words separated by "..."
|
*/
|
function get_context($text, $words, $length = 400) |
The $words is described as an array, but marked as an string in the doc-block.
@param string $words An array of words which should be contained in the result, has to be a valid part of a PCRE pattern (escape with preg_quote!) |
Should be changed to:
@param array $words An array of words which should be contained in the result, has to be a valid part of a PCRE pattern (escape with preg_quote!) |
Maybe change the function input, too, to:
function get_context(string $text, array $words, int $length = 400) |