Skip to content

[PHP] Enum method not found #8286

@NReib

Description

@NReib

Apache NetBeans version

Apache NetBeans 25 release candidate

What happened

The following 2 enums should demonstrate the Problem

namespace test;

enum TestA{

	case X;

	public function get(string $param): string{
		return '';
	}
}
namespace test;

enum TestB{

	case X;

	public function get(): string{
		return '';
	}
}

...

\test\TestA::X->get('xxx');

Now 2 things are wrong: we cannot go to declaration of method "get" and Ctrl + P does not work there either (Show param list).

Apparently in VariousUtils.java extractVariableTypeFromVariableBase the unqualified Classname is determined. If we change it to qualified Name the behaviour will be as expected. For StaticMethodInvocation the Qualified name is already used, so I assume there would be no harm in doing the same here.

Language / Project Type / NetBeans Component

No response

How to reproduce

x

Did this work correctly in an earlier version?

No / Don't know

Operating System

Mageia

JDK

x

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

No response

Are you willing to submit a pull request?

Yes

Metadata

Metadata

Assignees

Labels

PHP[ci] enable extra PHP tests (php/php.editor)kind:bugBug report or fix

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions