phpinspectionsea icon indicating copy to clipboard operation
phpinspectionsea copied to clipboard

Enums are treated as empty classes

Open Simbiat opened this issue 1 year ago • 2 comments

Subject Details
Plugin Php Inspections (EA Extended)
Language level PHP 8.3

Current behavior

Have code like

enum Suit: string
{
    case Hearts = 'H';
    case Diamonds = 'D';
    case Clubs = 'C';
    case Spades = 'S';
}

Suit: is highlighted with warning [EA] Class does not contain any properties or methods.

Expected behavior

No warning, since it is normal (and rather expected) for Enums not to have any methods or properties.

Environment details

PhpStorm 2024.1.1
Build #PS-241.15989.102, built on April 23, 2024
Licensed to simbiat.ru / Dmitry Kustov
Subscription is active until March 31, 2025.
For non-commercial open source development only.
Runtime version: 17.0.10+1-b1207.14 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11.0
GC: G1 Young Generation, G1 Old Generation
Memory: 5120M
Cores: 16
Registry:
  debugger.new.tool.window.layout=true
  run.processes.with.pty=TRUE
  ide.experimental.ui=true
Non-Bundled Plugins:
  com.jetbrains.space (241.15989.9)
  com.intellij.ml.llm (241.15989.156)
  com.kalessil.phpStorm.phpInspectionsEA (5.0.0.0)
  org.intellij.qodana (241.15989.121)

Simbiat avatar May 01 '24 12:05 Simbiat

This appears to be a duplicate of #1831

dehrk avatar Aug 12 '24 22:08 dehrk

Indeed, it is. Wonder why search did not find it for me when I was creating this.

Simbiat avatar Aug 13 '24 03:08 Simbiat

Duplicates #1831, please follow updates there - we are working on the fix.

ea-inspections-team avatar Sep 18 '24 09:09 ea-inspections-team