Closure parameters auto suggsest
How to get autosuggest working
trait Tapper
{
/**
* Call the given closure with the current instance.
*
* @param \Closure(static): void $callable Closure receives the same type as $this.
* @return static
*/
public function tap(\Closure $callable): static
{
$callable($this);
return $this;
}
}
class Person {
use Tapper;
public function getMyName() {
return 'hello';
}
}
class Animal {
use Tapper;
public function getBreed() {
return 'dog';
}
}
new Person()->tap(function($test) {
$test->//should autosuggest getMyName
});
new Animal()->tap(function($test) {
$test->//should autosuggest getBreed
}) then it works when i do
new Person()->tap(function(Person $test) {
$test->
});
new Animal()->tap(function(Animal $test) {
$test->
})
Please sign in to leave a comment.
Hello Gen,
Thank you for reporting! Please upvote WI-83591 to get notified about the updates.