I
I
Ivan Gontarenko2015-10-24 15:49:52
PHP
Ivan Gontarenko, 2015-10-24 15:49:52

How to set the type of the $this variable for autocomplete?

Hello!
How to define $this variable for phpstorm to autocomplete?
Code example

$app->get( '/auth/:action', function( $action ) {
        // $this === $app
        /** @var $this App */
        return $this->view->render( "auth.php" );
} );

/** @var $this App */- I know this method, but is it possible to somehow do without it?
use ( $app )also not an option.
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
Cat Anton, 2015-10-24
@27cm

/** @var App $this */

O
OnYourLips, 2015-10-24
@OnYourLips

You don't need to name the variable by that name. This will confuse people.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question