File tree 1 file changed +0
-21
lines changed
1 file changed +0
-21
lines changed Original file line number Diff line number Diff line change @@ -30,59 +30,38 @@ public function __construct(Directory $node)
30
30
$ this ->nodes = $ node ->children ();
31
31
}
32
32
33
- /**
34
- * Rewinds the Iterator to the first element.
35
- */
36
33
public function rewind (): void
37
34
{
38
35
$ this ->position = 0 ;
39
36
}
40
37
41
- /**
42
- * Checks if there is a current element after calls to rewind() or next().
43
- */
44
38
public function valid (): bool
45
39
{
46
40
return $ this ->position < count ($ this ->nodes );
47
41
}
48
42
49
- /**
50
- * Returns the key of the current element.
51
- */
52
43
public function key (): int
53
44
{
54
45
return $ this ->position ;
55
46
}
56
47
57
- /**
58
- * Returns the current element.
59
- */
60
48
public function current (): ?AbstractNode
61
49
{
62
50
return $ this ->valid () ? $ this ->nodes [$ this ->position ] : null ;
63
51
}
64
52
65
- /**
66
- * Moves forward to next element.
67
- */
68
53
public function next (): void
69
54
{
70
55
$ this ->position ++;
71
56
}
72
57
73
- /**
74
- * Returns the sub iterator for the current element.
75
- */
76
58
public function getChildren (): self
77
59
{
78
60
assert ($ this ->nodes [$ this ->position ] instanceof Directory);
79
61
80
62
return new self ($ this ->nodes [$ this ->position ]);
81
63
}
82
64
83
- /**
84
- * Checks whether the current element has children.
85
- */
86
65
public function hasChildren (): bool
87
66
{
88
67
return $ this ->nodes [$ this ->position ] instanceof Directory;
You can’t perform that action at this time.
0 commit comments