apache / apache/netbeans

[PHP] Accessing instance and static property on enum via method must produce error

Open
#5,081 0 comments 0 reactions 0 assignees View on GitHub
kind:feature PHP
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 16

### What happened

Enum method must produce error message on set/get property.

### How to reproduce

```php
propOne = $propOne; // this statement must display error
}
public function setPropTwo($propTwo) {
$this->propTwo = $propTwo; // this statement must display error
}
public function getPropOne() {
return $this->propOne; // this statement must display error
}
public function getPropTwo() {
return $this->propOne; // this statement must display error
}
public static function setStaticOne($staticOne) {
static::$staticOne = $staticOne; // this statement must display error
}
public static function getStaticOne() {
return static::$staticOne; // this statement must display error
}
}
```

related issue: [Accessing undeclared static property must produce error](https://github.com/apache/netbeans/issues/6019)

### Did this work correctly in an earlier version?

No / Don't know

### Operating System

Windows 10

### JDK

Java: 14.0.1; Java HotSpot(TM) 64-Bit Server VM 14.0.1+7 Runtime: Java(TM) SE Runtime Environment 14.0.1+7

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

_No response_

### Are you willing to submit a pull request?

No

### Code of Conduct

Yes

Contributor guide

Open the contributing guide

Research direction

No implementation files or tests are named. Reproduce the enum example in the PHP editor and inspect the existing diagnostics for declared and undeclared properties, then locate the PHP analysis entry point that handles property access. Done means instance and static property access through enum methods consistently produces the expected error messages.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.