Question

I have something like:

$elements = $document->query(...);
foreach ($elements as $element) {
    $element -> //I want content assist
}

But Aptana (Studio 3, build: 3.5.0.201401092130) is not giving me the content assist. if I do something like

$e = new DOMNode();
$e -> //content assist 

then I'm getting the content assist.

How can I get it to work on the $element in the foreach?

Était-ce utile?

La solution

I'm not an Aptana user but most decent IDEs allow type hinting with this syntax:

foreach ($elements as $element) {
    /* @var $element DOMNode */
    $element -> //I want content assist
}

... or, some times, this variation:

foreach ($elements as $element) {
    /* @var DOMNode $element  */
    $element -> //I want content assist
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top