class SnapshotNodeList
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
@internal This class is not covered by the backward compatibility promise for PHPUnit
@template-implements IteratorAggregate<int, DOMNode>
Hierarchy
- class \PHPUnit\TextUI\XmlConfiguration\SnapshotNodeList implements \Countable, \IteratorAggregate
Expanded class hierarchy of SnapshotNodeList
File
-
vendor/
phpunit/ phpunit/ src/ TextUI/ Configuration/ Xml/ Migration/ SnapshotNodeList.php, line 26
Namespace
PHPUnit\TextUI\XmlConfigurationView source
final class SnapshotNodeList implements Countable, IteratorAggregate {
/**
* @psalm-var list<DOMNode>
*/
private array $nodes = [];
public static function fromNodeList(DOMNodeList $list) : self {
$snapshot = new self();
foreach ($list as $node) {
$snapshot->nodes[] = $node;
}
return $snapshot;
}
public function count() : int {
return count($this->nodes);
}
public function getIterator() : ArrayIterator {
return new ArrayIterator($this->nodes);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
SnapshotNodeList::$nodes | private | property | @psalm-var list<DOMNode> |
SnapshotNodeList::count | public | function | |
SnapshotNodeList::fromNodeList | public static | function | |
SnapshotNodeList::getIterator | public | function |