Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

override return type in PHPDoc

Tags:

phpdoc

I have a class Abc with method (body is not important):

/**
 * @return SomeBaseClass
 */
function getAll() { ... }

In child class of Abc called AbcChild I'd like to redefine only type of returning class to see it properly in Netbeans. Can I do it without redefining method:

/**
 * @return SomeClass
 */
function getAll() { return parent::getAll(); }
like image 594
koral Avatar asked Dec 06 '13 11:12

koral


1 Answers

Try something like this:

/**
 * @method SomeClass getAll()
 */
class AbcChild
{
 // ....
}

More info about @method

like image 151
Londeren Avatar answered Nov 10 '22 22:11

Londeren