<?php
interface A {
public function test1();
}
class B {
public function test2() {
}
}
/**
* @phpstan-require-extends B
* @phpstan-require-implements A
*/
trait C {
public function test3() {
$this->test // shoud suggest test1(), test2() from A, B
}
}
https://phpstan.org/r/1d8da70d-b8f0-4d3a-b519-76ab2f8c6c95
Bug:
<?php
/**
* @phpstan-require-extends B --> `@extends tag specifies B type, but the corresponding class does not extends type by that name`, this is a wrong diagnosis.
*/
interface A {
public function test1();
}
class B {
public function test2() {
}
}
class C implements A { // shoud add problem here: Interface A requires implementing class to extend B, but C does not.
/**
* @inheritDoc
*/
public function test1() {
}
}
Note: PHPDoc tag @phpstan-require-(extends|implements) is only valid on trait or interface.
https://phpstan.org/r/1d8da70d-b8f0-4d3a-b519-76ab2f8c6c95
Bug:
Note: PHPDoc tag
@phpstan-require-(extends|implements)is only valid on trait or interface.