Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you hint return types in PHP 5.2.5?

I think my eclipse's ctrl+clicking links might benefit greatly...

Edit: I'm using eclipse PDT.

Edit 2: I'm very happy with the solution of putting docblocks before functions (and variables) with an @return or @var statement, I've just updated the documentation of my app and now eclipse is showing me what functions are available to what objects!

Awesome.

like image 684
Dean Rather Avatar asked Nov 21 '08 06:11

Dean Rather


2 Answers

// [...]
/**
 * Return the Request object
 *
 * @return Zend_Controller_Request_Abstract
 */
public function getRequest()
{
    return $this->_request;
}
// [...]

works perfectly with Eclipse PDT. Which plugin do you use?

like image 96
Stefan Gehrig Avatar answered Oct 05 '22 03:10

Stefan Gehrig


Short answer: no.

Long answer: consider adding docblocks with @return declarations.

like image 26
Edward Z. Yang Avatar answered Oct 05 '22 05:10

Edward Z. Yang