DataTypeNamespace complains about namespace when PHPStan types are used

Created on 11 May 2025, 4 days ago

Problem/Motivation

Coder complains with:

Data types in @var tags need to be fully namespaced (Drupal.Commenting.DataTypeNamespace.DataTypeNamespace)

When using PHPStan type imports https://phpstan.org/writing-php-code/phpdoc-types#local-type-aliases

Steps to reproduce

Define or import a type
Use the type in /** @var MyType $variableName */

Proposed resolution

Never complain about PHPStan types.

Perhaps coder should check if the class exists in the same namespace as the file, before complaining about non FQN's.

🐛 Bug report
Status

Active

Version

8.3

Component

Coder Sniffer

Created by

🇦🇺Australia dpi Perth, Australia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024