Is there a way to specify that a function will return an object of a specific type, where the type is the string of one of the parameters?
e.g.
/**
* @return object<$class>
*/
public function create(string $class): object {
... some factory stuff
}
so that vscode or phpstorm will know that when I do
$myvar = X::create('MyClass');
$myvar will be of type MyClass and I'll have the proper intellisense/autocompletion for it?