Open patrickkusebauch opened 7 months ago
What a coincidence, only encountered this just now as well :) Thanks for reporting it.
I saw #849. Here is a fairly simple example to trigger the uncovered type found in a @phpstan-type
annotation.
<?php
namespace App;
/**
* @phpstan-type TestType array<mixed>
*/
final class Test
{
/**
* @param TestType $content
*/
private function __construct(private readonly array $content)
{
}
}
parameters:
paths:
- ./src/App
layers:
- name: App
collectors:
- type: directory
value: src/App/.*
ruleset:
App: ~
I confirm this issue (and https://github.com/qossmic/deptrac/issues/849).
Both PhpStan and Psalm allow users to define type aliases:
However, Deptrac does not recognize them and assumes there exists a class with the name of the alias. This results in Deptrac complaining about an uncovered dependency on a class that does not exist.