Skip to content

Commit 9bfd2c8

Browse files
JulienMarliacnicklaw5
authored andcommitted
Add broadcaster_language param to getLiveStreams (#20)
Even if it's not in the official documentation it does workd and it's very handy !
1 parent d91c394 commit 9bfd2c8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Api/Streams.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,15 @@ public function getStreamByUser($userIdendifier, $streamType = 'live')
4141
* @param string $streamType
4242
* @param int $limit
4343
* @param int $offset
44+
* @param string $broadcaster_language
4445
* @throws InvalidTypeException
4546
* @throws InvalidIdentifierException
4647
* @throws InvalidStreamTypeException
4748
* @throws InvalidLimitException
4849
* @throws InvalidOffsetException
4950
* @return array|json
5051
*/
51-
public function getLiveStreams($channel = null, $game = null, $language = null, $streamType = 'live', $limit = 25, $offset = 0)
52+
public function getLiveStreams($channel = null, $game = null, $language = null, $streamType = 'live', $limit = 25, $offset = 0, $broadcaster_language = null)
5253
{
5354
if ($channel) {
5455
if (!is_string($channel)) {
@@ -73,6 +74,10 @@ public function getLiveStreams($channel = null, $game = null, $language = null,
7374
throw new InvalidTypeException('language', 'string', gettype($language));
7475
}
7576

77+
if ($broadcaster_language && !is_string($broadcaster_language)) {
78+
throw new InvalidTypeException('broadcaster_language', 'string', gettype($broadcaster_language));
79+
}
80+
7681
if (!$this->isValidStreamType($streamType)) {
7782
throw new InvalidStreamTypeException();
7883
}
@@ -89,6 +94,7 @@ public function getLiveStreams($channel = null, $game = null, $language = null,
8994
'channel' => $channel,
9095
'game' => $game,
9196
'language' => $language,
97+
'broadcaster_language' => $broadcaster_language,
9298
'stream_type' => $streamType,
9399
'limit' => intval($limit),
94100
'offset' => intval($offset),

0 commit comments

Comments
 (0)