Skip to content

Commit

Permalink
Merge pull request #18 from ecfy/master
Browse files Browse the repository at this point in the history
Fix for Clips::getTopClips
  • Loading branch information
nicklaw5 authored Apr 18, 2018
2 parents 4099709 + 3d9ec95 commit 29b566c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Api/Clips.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function getTopClips($channel = null, $cursor = null, $game = null, $limi
$validPeriods = ['day', 'week', 'month', 'all'];

if ($channel) {
if (!is_string($channel)) {
if (!is_string($channel)) {
throw new InvalidTypeException('channel', 'string', gettype($channel));
}

Expand All @@ -64,13 +64,13 @@ public function getTopClips($channel = null, $cursor = null, $game = null, $limi
}

if ($game) {
if (!is_string($game)) {
if (!is_string($game)) {
throw new InvalidTypeException('game', 'string', gettype($game));
}

$game = trim($game, ', ');
if ($count = count(explode(',', $game) > 10)) {
throw new TwitchApiException(sprintf('Only a maximum of 10 gamess can be queried. %d requested.', $count));
if ($count = count(explode(',', $game)) > 10) {
throw new TwitchApiException(sprintf('Only a maximum of 10 games can be queried. %d requested.', $count));
}
}

Expand Down

0 comments on commit 29b566c

Please sign in to comment.