Skip to content

Commit

Permalink
Fix setWeight positive integer check
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Hall committed Mar 21, 2018
1 parent 068b36e commit 9454079
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/WeightedBucket.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace RapidWeb\BucketTesting;

use RapidWeb\BucketTesting\Bucket;
use Exception;

class WeightedBucket
{
Expand All @@ -16,7 +17,7 @@ public function __construct(Bucket $bucket)

public function setWeight($weight)
{
if (!is_integer($weight) && $weight >= 1) {
if (!is_integer($weight) || $weight < 1) {
throw new Exception('Weight must be specified as a positive integer.');
}

Expand Down

0 comments on commit 9454079

Please sign in to comment.