Skip to content

Commit 7ac01bc

Browse files
committed
minor symfony#24564 add DOMElement as return type in Crawler::getIterator to support foreach support in ide (Haehnchen)
This PR was merged into the 3.3 branch. Discussion ---------- add DOMElement as return type in Crawler::getIterator to support foreach support in ide | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT In `Crawler::getIterator` return type is missing so ide (PhpStorm) is not able to provide completion inside foreach statements. This PR adds `DOMElement[]` to it ```php $crawler = new Crawler('foobar'); foreach($crawler->filter('a') as $link) { # support completion $link->... } ``` Commits ------- 2350597 add DOMElement as return type in Crawler::getIterator to support foreach support in ide
2 parents d32ecff + 2350597 commit 7ac01bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/DomCrawler/Crawler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ public function count()
10711071
}
10721072

10731073
/**
1074-
* @return \ArrayIterator
1074+
* @return \ArrayIterator|\DOMElement[]
10751075
*/
10761076
public function getIterator()
10771077
{

0 commit comments

Comments
 (0)