- Issue created by @dpi
- 🇦🇹Austria klausi 🇦🇹 Vienna
Thanks for reporting!
Can you put a full code example where the problem triggers in the issue summary?
I tried to reproduce with this, but works fine for me:
use Foo\Bar\Testi; /** * Example. * * @phpstan-type UserAddress array{street: string, city: string, zip: string} */ class Test { /** * Address in the form of an array, defined on the class comment. * * @var UserAddress */ protected $address; /** * Getter. * * @return UserAddress * The address. */ public function getAddress(): array { /** @var UserAddress $otherAddress */ $otherAddress = [new Testi()]; return $this->address; } }
What am I doing wrong?
Side note: Coder cannot check if classes exist. It is coding standards checker that cannot access/process other PHP files to check if classes exist. We are deliberately leaving that to PHPStan.
As far as I understand our DataTypeNamespaceSniff it only checks that if a type matches the use statement, then the FQN should be used.