Php doc block for method, return error in doc block

Hello!

I have under Settings -> File Templates Includes -> Php Function Comment
this script

------------------
/ **
$ {} PARAM_DOC
# if ($ {} TYPE_HINT! = "void") * @ return $ {} TYPE_HINT
# end
$ {} THROWS_DOC
* /
---------------------

When I generate the doc block I get the following output.
-----------------
/ **
      * @ Return $ this
      * /
     _erstelleZeileRechnungProdukt private function () {
        
         return $ this;
     }
-----------------------

The return value for the class in php doc is wrong.

Who can help?

Sincerely yours

Stephan

3 comments

Hi there,

There is nothing wrong with it (at very least from PhpStorm point of view)

http://youtrack.jetbrains.com/issue/WI-17111

0

Hello!

There are problems with PhpDoc, Apigen ... !
I have a method.
----------------------
/ **
      * @ Param $ __produktId
      * @ Return $ this
      * @ Throws nook_Exception
      * /
     public function setProduktId ($ __produktId)
     {
         $ ProductID = (int) $ __produktId;
         if (empty ($ ProductID))
             throw new nook_Exception ($ this-> _error_kein_int);

         $ this-> _produktId = $ productID;

         return $ this;
     }
--------------------------------
If I document this method with Apigen
I get the following representation.

This presentation is not correct.

fehler.jpg


With kind regards

Stephan

0

Post your comments/reasons/examples to that or duplicate tickets (or maybe even create your own ticket) so that devs will see it and take it into an account.

The move to use $this was made intentionally as it simplifies the life for most people, especially when writing fluid interface / chain calls code (just as you have described in your own thread: http://devnet.jetbrains.com/thread/443722 ). Plus -- the main (most widely used) documenting tool -- phpDocumentor -- supports it just fine (I've tested it myself).


In my opinion -- the best solution (for everyone) would be to have Apigen to support @return $this just like phpDocumentor does.

0

Please sign in to leave a comment.