We have the following issue, which I tried to simplify as much as possible:
class A {}
class B extends A {}
class ParentClass {
public function foo(): A { return new A(); }
}
class Mixin {
public function foo(): B { return new B(); }
public function foo2(): B { return new B(); }
}
/**
* @mixin Mixin
*/
class MyClass extends ParentClass {
public function bar() {
$foo = $this->foo();
$foo2 = $this->foo2();
}
}
When I hover over $foo, the popup declares its type as A $foo. Just to make sure the @mixin is processed at all, $foo2 is properly declared as B $foo.
In my opinion, as the @mixin directive is declared in MyClass, it should take precedence over properties and methods ParentClass.
Am I correct and this is a bug or is this just how it's supposed to be?