Zend Studio 7.2.1不会在PHPDoc块中自动创建@return

I recently upgraded from Zend Studio for Eclipse 6.1.2 to 7.2.1.

Directly above a PHP method which contains a return, when I type /** and hit ENTER as to let Zend Studio automatically generate the PHPDoc block, Zend Studio 7.2.1 creates the PHPDoc block successfully however it does not put an @return in the block. Zend Studio 6.2.1 did this perfectly.

I spent a lot of time playing around the with (extensive) preferences in Zend Studio 7.2.1 to no avail. Any ideas? Thanks!

I don't see @return being included in auto-docblocks in Eclipse PDT for Galileo or Helios versions. Perhaps the Eclipse PDT that ZS6 was based on used to do this, and it was removed in the later Eclipse PDT versions that ZS7 is based on.

Window->preferences->php->Code Style->Code Teplates : Coments->Method

Using Zend Studio 7.2.1, my "Window->preferences->php->Code Style->Code Teplates : Coments->Method" displays the following and still doesn't add the @return

/**

*

* ${cursor}${tags}

* @return data_type

*/

This is a known bug in PDT. It is fixed in PDT SVN. The resolution of the bug is, typing "/** ENTER" right before a function statement doesn't trigger the correct code template.

Until you upgrade to the latest PDT (or perhaps until ZS9 is released) you can use "Source -> Generate Element Comment" menu or "SHIFT + CTRL + J" shortcut, it'll do the trick.

Same bug and workaround applies for Zend Studio 8 branch.