Skip to content

Commit

Permalink
Add check for buffer size being zero or positive
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Dec 10, 2021
1 parent 7288ce0 commit 13dc5f1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Internal/EmitSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ final class EmitSource

public function __construct(int $bufferSize = 0)
{
if ($bufferSize < 0) {
throw new \ValueError('Argument #1 ($bufferSize) must be greater than or equal to 0, got ' . $bufferSize);
}

$this->bufferSize = $bufferSize;
}

Expand Down

0 comments on commit 13dc5f1

Please sign in to comment.