Skip to content

Commit 4bcbd8b

Browse files
Ensure that array contains only Line objects
1 parent 9fd2d48 commit 4bcbd8b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Chunk.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ public function getLines(): array
7979
*/
8080
public function setLines(array $lines): void
8181
{
82+
foreach ($lines as $line) {
83+
if (!$line instanceof Line) {
84+
throw new InvalidArgumentException;
85+
}
86+
}
87+
8288
$this->lines = $lines;
8389
}
8490
}

0 commit comments

Comments
 (0)