How to typehint context in an IDE?
问题 I am using Closure::call (http://php.net/manual/en/closure.call.php) to call an external closure inside a class context. Here's a simple repro: class Foo { private $bar = 'baz'; /** * Executes a closure in $this context and returns whatever the closure returns. * * @param \Closure $closure * @return mixed */ public function callClosureInThisContext(\Closure $closure) { return $closure->call($this); } } class Closures { /** * @return \Closure */ public function getClosureForFoo() : \Closure {