<?php
class One {}
class Two {}
/**
* @template T of object
*/
interface TestInterface
{
/**
* @param T $var
*/
public function setVariable(object $var): void;
}
/**
* @implements TestInterface<One>
*/
class Test implements TestInterface
{
public function setVariable(object $var): void
{
$this->var = $var;
}
}
$test = new Test();
$test->setVariable(new One());
$test->setVariable(new Two());
Here $test->setVariable(new Two());
is correctly underlined, but the tooltip shows function Test::setVariable(object $var): void
instead of function Test::setVariable(One $var): void
.