I recently discovered, that you can have phpdocs outside of classes and your IDE (like Eclipse) would autocomplete it.
For example:
<?php /* @var $this Controller */ ?> <div><?php echo $this->app()->name; ?></div>
Eclipse would autocomplete $this->
I found this code snippet in a framework, but I can't find any documentation about this type of phpdoc. Has anyone a link for me? I didn't know, this was possible?
Thanks in advance!
In eclipce I know this way (Eclipse completions - @var (PHPDoc) question):
$that = $this;
if (false) $that = new Controller();
And use $that
But it should work in phpStorm IDE (with @var phpdoc)