Open SenseException opened 8 years ago
The @return $this
is incorrect way of writing this and isn't supported by PhpDoc either. In ZendFramework this way was very popular however. The correct way would be @return static
.
Hi @aik099,
$this
is going to be part of PSR-5 (https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc.md#appendix-a-types at the bottom).
@scrutinizer-ci Would you consider implementing @return $this
?
I would also like to see this!
It seems that there was no answer yet. If @scrutinizer-ci is kind of occupied with other work, is there a way where I can implement this feature and create a PR? I appreciate feedback if I may be of help to Scrutinizer.
During My work on a PR for a PHP library I found a strange behaviour when it comes to Abstract classes using
@return $this
in a method's annotation.is extended by 2 other classes:
My\Namespace\Class
andMy\Namespace\OtherClass
. In a builder for commands, I have the following code:I get this message from Scrutinizer:
maybe because it is expected that
My\Namespace\OtherClass
should also containmethodName()
.Shouldn't
$this
in the annotation only refer to the instance wheresetHandler()
was invoked?