Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.9.3
-
Component/s: Zend_Reflection
-
Labels:None
-
Fix Version Priority:Nice to Have
Description
Hi!
It would be great to allow a single tag and multiple spaces in tags.
E.g. i annotated all my service methods with @service, but zend_reflection complains because no value is present
I also like to "format" my tags:
* @myfirsttag * @mysecondtag tagvalue * @param int $var * @return string some value
These changes are done with minor regular-expression-updates:
--- Tag.php (revision 15636) +++ Tag.php (working copy) @@ -55,7 +55,7 @@ - if (!preg_match('#^@(\w+)\s#', $tagDocblockLine, $matches)) { + if (!preg_match('#^@(\w+)(\s|$)#', $tagDocblockLine, $matches)) { @@ -107,13 +107,13 @@ - if (!preg_match('#^@(\w+)\s(.*)?#', $tagDocblockLine, $matches)) { + if (!preg_match('#^@(\w+)(?:\s+([^\s].*)|$)?#', $tagDocblockLine, $matches)) { =================================================================== --- Tag/Param.php (revision 15636) +++ Tag/Param.php (working copy) @@ -49,7 +49,7 @@ - if (!preg_match('#^@(\w+)\s(\w+)(?:\s(\$\S+))?(?:\s(.*))?#s', $tagDocblockLine, $matches)) { + if (!preg_match('#^@(\w+)\s+(\w+)(?:\s(\$\S+))?(?:\s([^\s].*))?#s', $tagDocblockLine, $matches)) { =================================================================== --- Tag/Return.php (revision 15636) +++ Tag/Return.php (working copy) @@ -43,7 +43,7 @@ - if (!preg_match('#^@(\w+)\s(\w+)(?:\s(.*))?#', $tagDocblockLine, $matches)) { + if (!preg_match('#^@(\w+)\s+(\w+)(?:\s+([^\s].*))?#', $tagDocblockLine, $matches)) {
thanks.
Attachments
Issue Links
| This issue is dependecy of: | ||||
| ZF-7351 | Zend_Reflection_Docblock_Tag has problems with @deprecated without whitespace at the end. |
|
|
|
| ZF-7484 | Zend_Reflection_Docblock_Tag does not handle tag description "0" |
|
|
|
| This issue is duplicated by: | ||||
| ZF-6961 | Zend_Reflection_Docblock_Tag_Param too restrictive with spaces when parsing tags |
|
|
|
I also know now why a single-tag did work under windows and not under linux:
because of \r\n newlines the $tagDocblockLine contains the \r!
So the expression "@\w+\s" did match becuase \s matches \r's
maybe we should add a change request for this issue too?
regards, Daniel.