Inspectopedia
 
2024.3

Ignored class alias declaration

Info
New
Last modified: 03 December 2024

Reports the class alias declarations that are ignored by the IDE because the actual class declaration with the same FQN exists.

The inspection is intended to clarify the IDE’s behavior in the cases when both the class and the class alias declarations are present. When several declarations with the same FQN exist, the IDE usually fails to choose a single one between them. This leads to incorrect code completion, erroneous type inference, and so on. Since the class declaration prevails over the class alias declaration, the latter becomes redundant and therefore ignored by the IDE.

Note that ignoring class alias declarations does not affect the behavior of the PHP interpreter.