-
Notifications
You must be signed in to change notification settings - Fork 2.5k
DocBlock Reflection not returning correct tags #5043
Conversation
I tried to maintain backward compatibility were I could, the only exceptions are:
|
{ | ||
$output = '@method' | ||
. (($this->isStatic) ? ' static' : '') | ||
. ((!empty($this->types)) ? ' ' . implode('|', $this->types) : '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May you can move the implode(...)
part to the parent class in some method like typesToString
@danez The PR conflicts with some code in master. Can you rebase it? |
@ralphschindler May you want to review this. |
Added new Interface for GeneratorTags Added Abstract Tag for Tags that have type
Tag class is now deprecated in favor of GenericTag
Rebased on master and moved the imploding to abstract class. |
Also allow is*() methods parallel to set*() methods in TagManager like isStatic() remove one redundant comment
test PropertyClassFactory
I think I tested all the new parts and should be ready for review |
Could you add class docblocks to all new classes describing and explaining the purpose of the class? |
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @package Zend_Code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove @Package
I added class descriptions, all other classes + namespace are selfexplanatory. |
The deprecated comments may need some version in them, but I'm not sure what to put there. 2.2.x? 2.3.0? |
2.3.0 -- this is a substantial change, so I'll target it for the next minor version. That said, the bits I saw were mostly BC, and the bits that weren't really didn't matter as you are not expected to create new instances manually for docblock tags (they should be created as part of reflection on their parents!). Add the deprecation comments, and I'll do final review -- and thanks! |
Sometimes you might do and instantiate tags when generating code without reflection. But yeah most of the time you do not. |
DocBlock Reflection not returning correct tags
Merged to develop for release with 2.3.0. |
thanks |
Currently when using reflection on a phpDoc the tags returned are not as expected. For example for an @return tag i expect Zend\Code\Generator\DocBlock\Tag\ReturnTag to be returned, but instead Zend\Code\Generator\DocBlock\Tag is always returned (which is missing the types-property from the reflection tag).
When working on a fix i encountered, that the whole generator tags topic does not work with reflection at all. e.g. AuthorTag throws an Exception about undefined function. And the nameing inside the Zend\Code\Generator\DocBlock\Tag* is completely off.
I would like to do a little rewrite, without breaking BC:
What do you think about that?