Skip to content

Commit 0856551

Browse files
authored
docs: iterator type for Crawler (#620)
* Document iterator type for Crawler * Add updated PHPDoc to changelog
1 parent 732d630 commit 0856551

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
2.1.2
5+
-----
6+
7+
* Updated PHPDoc: getIterator method on Crawler returns an ArrayIterator of WebDriverElements
8+
49
2.1.1
510
-----
611

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ parameters:
1818
# Require a redesign of the underlying Symfony components
1919
- '#Call to an undefined method DOMNode::getTagName\(\)\.#'
2020
- '#Return type \(void\) of method Symfony\\Component\\Panther\\DomCrawler\\Crawler::clear\(\) should be compatible with return type \(Facebook\\WebDriver\\WebDriverElement\) of method Facebook\\WebDriver\\WebDriverElement::clear\(\)#'
21+
- '#Return type \(ArrayIterator<int, Facebook\\WebDriver\\WebDriverElement>\) of method Symfony\\Component\\Panther\\DomCrawler\\Crawler::getIterator\(\) should be compatible with return type \(ArrayIterator<int, DOMNode>\) of method Symfony\\Component\\DomCrawler\\Crawler::getIterator\(\)#'

src/DomCrawler/Crawler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,9 @@ public function count(): int
365365
return \count($this->elements);
366366
}
367367

368+
/**
369+
* @return \ArrayIterator<int, WebDriverElement>
370+
*/
368371
public function getIterator(): \ArrayIterator
369372
{
370373
return new \ArrayIterator($this->elements);

0 commit comments

Comments
 (0)