Skip to content

Commit

Permalink
feat: validates input
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Nov 6, 2023
1 parent 18a06f6 commit 4e83a6f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public static function make(string $url): self
*/
public function duration(int $seconds): self
{
assert($seconds > 0, 'The duration must be greater than 0 seconds.');

$this->duration = $seconds;

return $this;
Expand All @@ -72,6 +74,8 @@ public function duration(int $seconds): self
*/
public function concurrency(int $requests): self
{
assert($requests > 0, 'The concurrency must be greater than 0 requests.');

$this->concurrency = $requests;

return $this;
Expand Down

0 comments on commit 4e83a6f

Please sign in to comment.