ÿØÿàJFIFÿÛ„ ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /var/www/html/123vid/vendor/nicklaw5/twitch-api-php/src/Api/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/123vid/vendor/nicklaw5/twitch-api-php/src/Api/Search.php
<?php

namespace TwitchApi\Api;

use TwitchApi\Exceptions\InvalidLimitException;
use TwitchApi\Exceptions\InvalidOffsetException;
use TwitchApi\Exceptions\InvalidTypeException;
use TwitchApi\Exceptions\TwitchApiException;

trait Search
{
    /**
     * Search for channels by name or description
     *
     * @param string $query
     * @param int    $limit
     * @param int    $offset
     * @throws InvalidTypeException
     * @throws TwitchApiException
     * @throws InvalidLimitException
     * @throws InvalidOffsetException
     * @return array|json
     */
    public function searchChannels($query, $limit = 25, $offset = 0)
    {
        if (!is_string($query)) {
            throw new InvalidTypeException('Query', 'string', gettype($query));
        }

        if (empty($query)) {
            throw new TwitchApiException('A \'query\' parameter is required.');
        }

        if (!$this->isValidLimit($limit)) {
            throw new InvalidLimitException();
        }

        if (!$this->isValidOffset($offset)) {
            throw new InvalidOffsetException();
        }

        $params = [
            'query' => $query,
            'limit' => intval($limit),
            'offset' => intval($offset),
        ];

        return $this->get('search/channels', $params);
    }

    /**
     * Search for games by name
     *
     * @param string $query
     * @throws InvalidTypeException
     * @throws TwitchApiException
     * @return array|json
     */
    public function searchGames($query)
    {
        if (!is_string($query)) {
            throw new InvalidTypeException('Query', 'string', gettype($query));
        }

        if (empty($query)) {
            throw new TwitchApiException('A \'query\' parameter is required.');
        }

        return $this->get('search/games', ['query' => $query]);
    }

    /**
     * Search for streams by channel description or game name
     *
     * @param string  $query
     * @param int     $limit
     * @param int     $offset
     * @param boolean $hls
     * @throws InvalidTypeException
     * @throws TwitchApiException
     * @throws InvalidLimitException
     * @throws InvalidOffsetException
     * @return array|json
     */
    public function searchStreams($query, $limit = 25, $offset = 0, $hls = null)
    {
        if (!is_string($query)) {
            throw new InvalidTypeException('Query', 'string', gettype($query));
        }

        if (empty($query)) {
            throw new TwitchApiException('A \'query\' parameter is required.');
        }

        if (!$this->isValidLimit($limit)) {
            throw new InvalidLimitException();
        }

        if (!$this->isValidOffset($offset)) {
            throw new InvalidOffsetException();
        }

        if ($hls !== null && !is_bool($hls)) {
            throw new InvalidTypeException('HLS', 'boolean', gettype($hls));
        }

        $params = [
            'query' => $query,
            'limit' => intval($limit),
            'offset' => intval($offset),
            'hls' => $hls,
        ];

        return $this->get('search/streams', $params);
    }
}

ZeroDay Forums Mini