This is especially useful when specifying concrete methods in children of doctrine repositories. Following returns TypeCoercion error
<?php
namespace A;
class A {
}
namespace B;
use A\A;
/**
* @method A find()
*/
class B extends \E\VendorE {
}
namespace C;
use B\B;
use D\D;
class C {
public function bar(): void {
$a = (new B())->find();
$d = new D() ;
$d->baz($a);
}
}
namespace D;
class D {
public function baz(\A\A $a): void {
return;
}
}
namespace E;
class VendorE {
public function find(): object {
return new $_GET['stuff'];
}
}
This is especially useful when specifying concrete methods in children of doctrine repositories. Following returns TypeCoercion error