From 4e83a6f7c2d18a4370d24e6ba2412ec4a0a91cb6 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Mon, 6 Nov 2023 07:52:16 +0000 Subject: [PATCH] feat: validates input --- src/Factory.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Factory.php b/src/Factory.php index a1c60b6..f50a9f6 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -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; @@ -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;