X

{@inheritdoc} tag support added

This blog post has been contributed by our NetBeans PHP user Junichi Yamamoto who is helping a lot with implementing enhancements and fixing issues in all the areas of NetBeans PHP support. He has also contributed a few plugins, e.g. support for CakePHP framework. He would like to tell you a few words about one new PHP feature in NetBeans. Thanks a lot, Junichi!

Hi all. Today we will show you the {@inheritdoc} tag support for PHPDoc comments which will be available in the next NetBeans version.

You can use this support when you extend a class or override a method.
Simply add only {@inheritdoc} to a PHPDoc comment of a child class if you want to use the same one as the parent.
And you can see the description of the parent class in the PHP document window using the code completion.

Let's see an example: 

<?php
/**
* The summary of BaseClass.
*
* The description of BaseClass.
* @author junichi11
*/
class BaseClass
{
/**
* test method of BaseClass.
*
* @param string $param1
* @param int $param2
*/
public function test($param1, $param2) {
}
}
/**
* {@inheritdoc}
*/
class ChildClass extends BaseClass
{
/**
* {@inheritdoc}
*/
public function test($param1, $param2) {
}
}

Which in the IDE in the case of the class results in:

{@inheritdoc} for a class

And in the case of the method:

{@inheritdoc} for a method

That's all for today. As always, please test it. It's available in the development version.
If you find some issues or enhancements, please report them to NetBeans Bugzilla(component php, subcomponent Editor). Thanks.

Join the discussion

Comments ( 2 )
  • &Aacute;lvaro Gonz&aacute;lez Tuesday, February 23, 2016

    I wasn't aware that the tag needed brackets. I've been using it wrong! (*blush*)

    Glad to see that PHP support is alive and kicking.


  • guest Thursday, March 17, 2016

    At last! Thank you for helping out and pushing this feature, Junichi! I have no idea how many times I looked at the ticket until I grew tired of waiting. Today I stumbled upon that ticket again and saw the changes, and also found this news entry.

    Good job!


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
Oracle

Integrated Cloud Applications & Platform Services