Skip to content

Commit 6a889d8

Browse files
Document assumption that we have a Directory object
1 parent 199654a commit 6a889d8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Node/Iterator.php

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010
namespace SebastianBergmann\CodeCoverage\Node;
1111

12+
use function assert;
1213
use function count;
1314
use RecursiveIterator;
1415

@@ -74,6 +75,8 @@ public function next(): void
7475
*/
7576
public function getChildren(): self
7677
{
78+
assert($this->nodes[$this->position] instanceof Directory);
79+
7780
return new self($this->nodes[$this->position]);
7881
}
7982

0 commit comments

Comments
 (0)