/** * This is not an actual endpoint */ public function __construct($user, $blocked_user, $client = null) { parent::__construct($client); $this->_user = $user; $this->_blocked_user = $blocked_user; $this->_endpoint = $this->_base_endpoint = "users/{$user}/blocks/{$blocked_user}"; }
function __construct($channel, $post_id, $client = null) { parent::__construct($client); $this->_channel = $channel; $this->_post_id = $post_id; $this->_endpoint = $this->_base_endpoint = "feed/{$channel}/posts/{$post_id}"; }
/** * Providing no channel falls back to the /channel endpoint * * @param string $channel_name * @param mixed */ function __construct($channel_name = "", $client = null) { parent::__construct($client); $this->_channel = $channel_name; $this->_endpoint = $this->_base_endpoint = 'channels/' . $channel_name; if (empty($channel_name)) { if (empty(Twitch::getAccessToken())) { throw new ChannelException("Please provide a channel name, or use Twitch::setAccessToken() to define the channels access token."); } if (Twitch::$scope->isAuthorized('channel_read') === false) { throw new TwitchScopeException("You do not have sufficient scope priviledges to run this command. Make sure you're authorized for `channel_read`.", 401); } $this->_endpoint = 'channel'; } }
public function __construct($client = null) { parent::__construct($client); $this->_endpoint = $this->_base_endpoint = 'streams'; }
public function __construct($channel = false, $client = null) { parent::__construct($client); $this->_channel = $channel; $this->_endpoint = $this->_base_endpoint = 'chat'; }
/** * @test */ public function test_recieving_expected_response_decoded() { $test_file = file_get_contents(__DIR__ . '/data/channel.json'); $base_method = new BaseMethod($this->getClient([new Response(200, [], $test_file)])); $this->assertEquals(json_decode($test_file), $base_method->send()); }