Skip to content

Commit 584ff05

Browse files
committed
Add return type to getIterator() methods
Rector's `AddReturnTypeDeclarationBasedOnParentClassMethodRector` now reports these five methods, which makes the Rector check fail.
1 parent 73ee581 commit 584ff05

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎src/Comments.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function jsonSerialize()
6666
}
6767

6868
#[ReturnTypeWillChange]
69-
public function getIterator()
69+
public function getIterator(): \Traversable
7070
{
7171
return new ArrayIterator($this->comments);
7272
}

‎src/Flags.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function jsonSerialize()
7373
}
7474

7575
#[ReturnTypeWillChange]
76-
public function getIterator()
76+
public function getIterator(): \Traversable
7777
{
7878
return new ArrayIterator($this->flags);
7979
}

‎src/Headers.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function jsonSerialize()
7373
}
7474

7575
#[ReturnTypeWillChange]
76-
public function getIterator()
76+
public function getIterator(): \Traversable
7777
{
7878
return new ArrayIterator($this->toArray());
7979
}

‎src/References.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function jsonSerialize()
5555
}
5656

5757
#[ReturnTypeWillChange]
58-
public function getIterator()
58+
public function getIterator(): \Traversable
5959
{
6060
return new ArrayIterator($this->references);
6161
}

‎src/Translations.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function ($translation) {
8585
}
8686

8787
#[ReturnTypeWillChange]
88-
public function getIterator()
88+
public function getIterator(): \Traversable
8989
{
9090
return new ArrayIterator($this->translations);
9191
}

0 commit comments

Comments
 (0)