Some IDEs have a notation like such for dynamic constructs such as functions that return different types, iteration such as with foreach, etc. It looks like a normal @var PHPdoc but can be multiple lines or 1 line.<br><br>
/**<br> * Assume the assigned variable gets this type.<div> * Note an alias never works this way. Only the full class name works even if there is a use statement (which is unlike PHPDoc 2)<br> * @var SomeClass<br> */<br>$a = $this->get('something'); // Dependency injection in Symfony 2<br>
<br>/**<br> * If an argument is specified after the type, that is the variable affected<br> * @var TypeInTheArray $b<br> */<br>foreach ($a as $b) {}<br><br>// @var TypeInTheArray $b<br>foreach ($a as $b) {}<br><br>Another big one:<br>
<?php<br>// Alias<br>use A\B\C as SomeClass;<br><br>$a = new SomeClass();<br>$a-> ctrl+space here gives only Kate's autocomplete, so it seems while here is support for writing 'new A\B\C' and getting the correct type, aliases are totally not supported (even without the 'as' clause).<br>
<br>Do we have anything similar or thoughts on how to handle these situations?<br><br>Andrew</div>