Skip to content

Commit

Permalink
Document assumption that we have a Directory object
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Dec 8, 2024
1 parent 199654a commit 6a889d8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Node/Iterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/
namespace SebastianBergmann\CodeCoverage\Node;

use function assert;
use function count;
use RecursiveIterator;

Expand Down Expand Up @@ -74,6 +75,8 @@ public function next(): void
*/
public function getChildren(): self
{
assert($this->nodes[$this->position] instanceof Directory);

return new self($this->nodes[$this->position]);
}

Expand Down

0 comments on commit 6a889d8

Please sign in to comment.