Skip to content

Commit

Permalink
fix: Forbid null for User and related items rec
Browse files Browse the repository at this point in the history
  • Loading branch information
eomiso committed Jul 11, 2022
1 parent a160ddc commit 19d9a63
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ZaiClient/Requests/RelatedItemsRecommendationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public function __construct($item_id, $limit, $options = array())
if (!(is_null(null) || strlen($item_id) > 0 && strlen($item_id) <= 100))
throw new \InvalidArgumentException('Length of item id must be between 1 and 100.');

if (!(is_null(null) || (0 < $limit && $limit <= 1000000)))
throw new \InvalidArgumentException('Limit must be null or between 1 and 1000,000.');
if (!(0 < $limit && $limit <= 1000000))
throw new \InvalidArgumentException('Limit must be between 1 and 1000,000.');

if (isset($options['offset'])) {
if (!(0 <= $options['offset'] && $options['offset'] <= 1000000))
Expand Down
4 changes: 2 additions & 2 deletions src/ZaiClient/Requests/UserRecommendationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public function __construct($user_id, $limit, $options = array())
if (!(is_null(null) || strlen($user_id) > 0 && strlen($user_id) <= 100))
throw new \InvalidArgumentException('Length of user id must be between 1 and 100.');

if (!(is_null(null) || (0 < $limit && $limit <= 1000000)))
throw new \InvalidArgumentException('Limit must be null or between 1 and 1000,000.');
if (!(0 < $limit && $limit <= 1000000))
throw new \InvalidArgumentException('Limit must be between 1 and 1000,000.');

if (isset($options['offset'])) {
if (!(0 <= $options['offset'] && $options['offset'] <= 1000000))
Expand Down

0 comments on commit 19d9a63

Please sign in to comment.