[DomCrawler] fix return type declarations

This commit is contained in:
Nicolas Grekas 2019-08-24 17:35:14 +02:00
parent 2ea98bb4a1
commit 2b8ef1d6d7

View File

@ -43,7 +43,7 @@ class Crawler implements \Countable, \IteratorAggregate
private $document; private $document;
/** /**
* @var \DOMElement[] * @var \DOMNode[]
*/ */
private $nodes = []; private $nodes = [];
@ -55,9 +55,7 @@ class Crawler implements \Countable, \IteratorAggregate
private $isHtml = true; private $isHtml = true;
/** /**
* @param mixed $node A Node to use as the base for the crawling * @param \DOMNodeList|\DOMNode|\DOMNode[]|string|null $node A Node to use as the base for the crawling
* @param string $uri The current URI
* @param string $baseHref The base href value
*/ */
public function __construct($node = null, $uri = null, $baseHref = null) public function __construct($node = null, $uri = null, $baseHref = null)
{ {
@ -102,7 +100,7 @@ class Crawler implements \Countable, \IteratorAggregate
* This method uses the appropriate specialized add*() method based * This method uses the appropriate specialized add*() method based
* on the type of the argument. * on the type of the argument.
* *
* @param \DOMNodeList|\DOMNode|array|string|null $node A node * @param \DOMNodeList|\DOMNode|\DOMNode[]|string|null $node A node
* *
* @throws \InvalidArgumentException when node is not the expected type * @throws \InvalidArgumentException when node is not the expected type
*/ */
@ -1049,7 +1047,7 @@ class Crawler implements \Countable, \IteratorAggregate
/** /**
* @param int $position * @param int $position
* *
* @return \DOMElement|null * @return \DOMNode|null
*/ */
public function getNode($position) public function getNode($position)
{ {
@ -1065,7 +1063,7 @@ class Crawler implements \Countable, \IteratorAggregate
} }
/** /**
* @return \ArrayIterator|\DOMElement[] * @return \ArrayIterator|\DOMNode[]
*/ */
public function getIterator() public function getIterator()
{ {
@ -1146,7 +1144,7 @@ class Crawler implements \Countable, \IteratorAggregate
/** /**
* Creates a crawler for some subnodes. * Creates a crawler for some subnodes.
* *
* @param \DOMElement|\DOMElement[]|\DOMNodeList|null $nodes * @param \DOMNodeList|\DOMNode|\DOMNode[]|string|null $nodes
* *
* @return static * @return static
*/ */