netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

[PHP] Inheriting docs is broken

Open terax6669 opened this issue 3 years ago • 0 comments

Apache NetBeans version

Apache NetBeans 15

What happened

NetBeans doesn't inherit docs for class properties, see example below.

How to reproduce

<?php

/**
 * This works fine
 */
class Foo
{
	/**
	 * This thing is broken
	 */
	public $bar;

	/**
	 * This also works fine
	 */
	public function foobar() {}
}

class Bar extends Foo
{
	public $bar = 'bar';

	public function foobar() {}
}

/**
 * {@inheritDoc}
 */
class FooBar extends Foo
{
	/**
	 * {@inheritDoc}
	 */
	public $bar = 'bar';

	/**
	 * {@inheritDoc}
	 */
	public function foobar() {}
}

/**
 * {@inheritDoc} trying to extend docs
 * won't work!
 */
class FooBarFoo extends Foo
{
	/**
	 * {@inheritDoc} this is just ridiculous
	 */
	public $bar = 'bar';

	/**
	 * {@inheritDoc} sadly this is also broken
	 */
	public function foobar() {}
}

$foo = new Foo;            // IDE hint: This works fine
$foo->bar;                 // IDE hint: This thing is broken
$foo->foobar();            // IDE hint: This is ridiculous

$bar = new Bar;            // IDE hint: This works fine
$bar->bar;                 // IDE hint:
$bar->foobar();            // IDE hint: This also works fine

$foobar = new FooBar;      // IDE hint: This works fine
$foobar->bar;              // IDE hint: {@inheritDoc}
$foobar->foobar;           // IDE hint: This also works fine

$foobarfoo = new FooBarFoo; // IDE hint: {@inheritDoc} trying to extend docs won't work!
$foobarfoo->bar;            // IDE hint: {@inheritDoc} this is just ridiculous
$foobarfoo->foobar;         // IDE hint: {@inheritDoc} sadly this is also broken

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows 11 Pro 22000.978

JDK

OpenJDK 19.0.0 (from Chocolatey)

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

https://pear.php.net/package/PhpDocumentor/docs/latest/phpDocumentor/tutorial_tags.inlineinheritdoc.pkg.html

Are you willing to submit a pull request?

No

Code of Conduct

Yes

terax6669 avatar Sep 25 '22 16:09 terax6669