-
Notifications
You must be signed in to change notification settings - Fork 115
Closed
Description
| Subject | Details |
|---|---|
| Plugin | Php Inspections (EA Extended), 5.4.0 |
| Language level | php 8.1 |
Current behaviour
generics with @template of Interface not working correctly.
Here is my following phpDoc
/**
* @template T of TestInterface
* @param T $test
* @return T
*/
public function callTest(TestInterface $test): TestInterfaceIn a method where $test is typehinted to a specific class, implementing TestInterface
public function (Test1 $test)
{
$test = $otherClass->callTest($test);
}Here, PhpStorm understand $test is still an instance of Test1 but EA gives me a warning
[EA] New value type (TestInterface) is not matching the resolved parameter type and might introduce types-related false-positives.
Expected behaviour
EA should interpret generics and that the returned object is of the same instance as the one passed in argument.
Environment details
Build #PS-252.27397.112, built on October 24, 2025