PHP annotation array (key, value)
I am working with Netbeans 8.0.2.
Is there a way to declare (and using course autocomplete) the array key and value types of the @return array annotation?
how
@return array[string]Class2
Or how:
@return Class2[string]
This way Netbeans should have no problem with autocomplete with the following foreach:
foreach($aArray as $sString => $oClass2){ ... }
I am aware of the following annotation method:
@return Class2[]
But this way I have no idea how to get the autocomplete on the string key.
Of course "String" is not autocomplete, but let's say we want to add another Object instead of a string as a key, then how can I tell my IDE to tell it and get the autocomplete correct?
+3
source to share
2 answers