Aggiornato Composer
This commit is contained in:
@@ -2,17 +2,24 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
use DOMElement;
|
||||
use DOMNodeList;
|
||||
use Iterator;
|
||||
use ReturnTypeWillChange;
|
||||
use function count;
|
||||
use function get_class;
|
||||
use function sprintf;
|
||||
|
||||
abstract class ElementCollection implements \Iterator {
|
||||
/** @template-implements Iterator<int,DOMElement> */
|
||||
abstract class ElementCollection implements Iterator {
|
||||
/** @var DOMElement[] */
|
||||
private $nodes = [];
|
||||
|
||||
@@ -24,7 +31,7 @@ abstract class ElementCollection implements \Iterator {
|
||||
$this->importNodes($nodeList);
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
#[ReturnTypeWillChange]
|
||||
abstract public function current();
|
||||
|
||||
public function next(): void {
|
||||
@@ -36,7 +43,7 @@ abstract class ElementCollection implements \Iterator {
|
||||
}
|
||||
|
||||
public function valid(): bool {
|
||||
return $this->position < \count($this->nodes);
|
||||
return $this->position < count($this->nodes);
|
||||
}
|
||||
|
||||
public function rewind(): void {
|
||||
@@ -51,7 +58,7 @@ abstract class ElementCollection implements \Iterator {
|
||||
foreach ($nodeList as $node) {
|
||||
if (!$node instanceof DOMElement) {
|
||||
throw new ElementCollectionException(
|
||||
\sprintf('\DOMElement expected, got \%s', \get_class($node))
|
||||
sprintf('\DOMElement expected, got \%s', get_class($node))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user