PHPStan has supported what is called declaration-site variance for a long time. An example you might be familiar with is the infamous @template-covariant. And although not as often useful, it also has a contravariant counterpart.
‹ Vylepšení v práci s parametry předávanými referencí v PHPStan 1.10.60 Použití RuleErrorBuilder k obohacení hlášených chyb ve vlastních pravidlech ›