How to document a $this in a Laravel Macro Closure?

242 Views Asked by At

Suppose I have a Macro registered in my package ServiceProvider and I am writing documentation for my package.

\Laravel\Dusk\Browser::macro('scrollToElement', function ($element = null) {
    $this->script("$('html, body').animate({ scrollTop: $('$element').offset().top }, 0);");

    return $this;
});

Now how do I document the variable $this in the Closure?

0

There are 0 best solutions below