2017 © Pedro Peláez
 

library riotquest

RiotQuest, PHP RiotAPI client library that focused on multi request from OP.GG

image

opgg/riotquest

RiotQuest, PHP RiotAPI client library that focused on multi request from OP.GG

  • Wednesday, June 27, 2018
  • by kargnas
  • Repository
  • 5 Watchers
  • 5 Stars
  • 876 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 5 Versions
  • 9 % Grown

The README.md

riotapi-request

Features

  • DTO Support
  • Batch calls (async request using guzzlehttp promise)
    • You can control concurrency sessions

Installation

composer require opgg/riotquest

Example

use RiotQuest\Dto\LolStaticData\Champion\ChampionListDto;
use RiotQuest\Dto\Summoner\SummonerDto;
use RiotQuest\RequestMethod;

function riotApi() {
    return new RiotQuest\AsyncRiotAPI('api_key');
}

/** @var SummonerDto $summonerDto */
$summonerDto = $this->riotApi()->call(new RequestMethod\Summoner\SummonerByName(OPServer::getCurrentPlatform(), "kargnas"));
$this->assertTrue($summonerDto instanceof SummonerDto);
$this->assertTrue($summonerDto->revisionDate instanceof \RiotQuest\Dto\DateTime);

$this->riotApi()
    ->add(new RequestMethod\Runes\RunesBySummoner(OPServer::getCurrentPlatform(), $summonerDto->id),
        function (\RiotQuest\Dto\Runes\RunePagesDto $runePagesDto) use ($summonerDto) {
            var_dump($runePagesDto->summonerId === $summonerDto->id);
            var_dump(array_first($runePagesDto->pages) instanceof \RiotQuest\Dto\Runes\RunePageDto);
        })
    ->add(new RequestMethod\Masteries\MasteriesBySummoner(OPServer::getCurrentPlatform(), $summonerDto->id),
        function (\RiotQuest\Dto\Masteries\MasteryPagesDto $masteryPagesDto) use ($summonerDto) {
            var_dump($masteryPagesDto->summonerId === $summonerDto->id);
            var_dump(array_first($masteryPagesDto->pages) instanceof \RiotQuest\Dto\Masteries\MasteryPageDto);
        })
    ->add(new RequestMethod\Match\MatchesByAccount(OPServer::getCurrentPlatform(), $summonerDto->accountId),
        function (\RiotQuest\Dto\Match\MatchlistDto $matchlist) {
            /** @var \RiotQuest\Dto\Match\MatchDto $match */
            $match = $this->riotApi()->call(new RequestMethod\Match\MatchById(OPServer::getCurrentPlatform(), $matchlist->matches[0]->gameId));
            var_dump($match instanceof \RiotQuest\Dto\Match\MatchDto);

            /** @var \RiotQuest\Dto\Match\Timeline\MatchTimelineDto $timeline */
            $timeline = $this->riotApi()->call(new RequestMethod\Match\TimelineById(OPServer::getCurrentPlatform(), $matchlist->matches[0]->gameId));
            var_dump($timeline instanceof \RiotQuest\Dto\Match\Timeline\MatchTimelineDto);
            var_dump($timeline->frames[0] instanceof \RiotQuest\Dto\Match\Timeline\MatchFrameDto);
        })
    ->exec();

TODO

  • Rate limit
  • PSR-6

The Versions

27/06 2018

dev-master

9999999-dev http://op.gg/

RiotQuest, PHP RiotAPI client library that focused on multi request from OP.GG

  Sources   Download

MIT

The Requires

 

The Development Requires

curl rest http client guzzle http client

02/01 2018

v0.6.0

0.6.0.0 http://op.gg/

RiotQuest, PHP RiotAPI client library that focused on multi request from OP.GG

  Sources   Download

MIT

The Requires

 

The Development Requires

curl rest http client guzzle http client

08/11 2017

dev-dev

dev-dev http://op.gg/

RiotQuest, PHP RiotAPI client library that focused on multi request from OP.GG

  Sources   Download

MIT

The Requires

 

The Development Requires

curl rest http client guzzle http client

08/08 2017

v0.5.1

0.5.1.0 http://op.gg/

RiotQuest, PHP RiotAPI client library that focused on multi request from OP.GG

  Sources   Download

MIT

The Requires

 

The Development Requires

curl rest http client guzzle http client

24/07 2017

v0.5

0.5.0.0 http://op.gg/

RiotQuest, PHP RiotAPI client library from OP.GG

  Sources   Download

MIT

The Requires

 

The Development Requires

curl rest http client guzzle http client