Inspectopedia Help

Ignored class alias declaration

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

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

PhpIgnoredClassAliasDeclaration
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | PHP | General

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.

Inspection Details

By default bundled with:

PhpStorm 2024.2, Qodana for PHP 2024.2,

Can be installed with plugin:

PHP, 242.22893

Last modified: 11 September 2024