Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.7.6, 1.7.7, 1.7.8, 1.8.0, 1.8.1, 1.8.2
-
Fix Version/s: 1.10.0
-
Component/s: Zend_Server_Reflection
-
Labels:None
Description
Zend_Server_Reflection_Function_Abstract, line 296:
if (preg_match_all('/@param\s+\S+\s+(\$^\S+)\s+(.*?)(@|\*\/)/s', $docBlock, $matches))
This regular expression is to extract the parameter name and description from a parameter definition comment:
@param paramType $paramName Parameter Description
The part that scans for a variable name,
(\$^\S+)
(\$^\s+)
I.e.
"dollar sign followed by one or more characters that are not - not whitespace"
must read
"dollar sign followed by one or more characters that are not whitespace"
Attachments
Issue Links
| This issue is duplicated by: | ||||
| ZF-7344 | Zend_Server_Reflection_Function_Abstract parameter description matching regex is broken |
|
|
|
Actually, the regex means "dollar sign followed by the beginning of a line followed by one or more characters that are not whitespace".
A circumflex outside of a character class (square brackets) means the beginning of a line, whereas a circumflex as the first character in a character class means that the character does not match any of the characters in the character class.
The part that scans for a variable name,
should instead read
i.e. just remove the extraneous circumflex