Skip to content

Commit

Permalink
Allow null
Browse files Browse the repository at this point in the history
  • Loading branch information
sirn-se committed Jul 2, 2024
1 parent 79bef39 commit de5ce2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public function addMiddleware(MiddlewareInterface $middleware): self
*/
public function setMaxConnections(int|null $maxConnections): self
{
if ($maxConnections < 1) {
if ($maxConnections !== null && $maxConnections < 1) {
throw new InvalidArgumentException("Invalid maxConnections '{$maxConnections}' provided");
}
$this->maxConnections = $maxConnections;
Expand Down
1 change: 1 addition & 0 deletions tests/suites/server/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public function testServerConfiguration(): void
});
$this->assertSame($server, $server->setTimeout(300));
$this->assertSame($server, $server->setFrameSize(64));
$this->assertSame($server, $server->setMaxConnections(null));
$this->assertSame($server, $server->setMaxConnections(64));
$this->assertSame($server, $server->addMiddleware(new Callback()));

Expand Down

0 comments on commit de5ce2d

Please sign in to comment.