-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Labels
Description
Feature request
Would it be possible to add generic support to functions that are defined via @method docs?
<?php declare(strict_types = 1);
/**
* @template T
* @template K
*
* @method bool compare<T, K>(T $t, K $k) Compares two objects magically somehow
* @method bool dumbCompare($t, $k) Compares without generics
*/
class HelloWorld
{
public function __call(): mixed {
return true;
}
}
$h = new HelloWorld();
$h->compare(1, 4);
$h->dumbCompare(5, 3);https://phpstan.org/r/1da86817-e322-401b-938d-6272e51d85e0
Did PHPStan help you today? Did it make you happy in any way?
Yes! It's helped me a lot with avoiding errors in my projects because I would mess up types. Especially generic support, which is incredibly useful ❤️
Reactions are currently unavailable