PHPDoc for fluent interface in subclass?
Is there any why to make my IDE (actually PHPStorm) understand that: $student->setName('Marco'); Will return an instance of Student , without redefining setName() in the subclass (only for adding PHPDoc comments)? class Person { private $name; /** * @param string $name * @return Person */ public function setName($name) { $this->name = $name; return $this; } } class Student extends Person { } You can return $this instead of person in your docblock you have to overwrite your method tag as comment like this /** * @method Student setName($name) */ class Student extends Person { } In my experience,