simivar/riot-php

Dependency-injection based wrapper around Riot Games APIs.

1.0.0 2020-11-20 02:28 UTC

README

PHP wrapper around Riot Games APIs.

Features

  • 🎉 PSR-18 & PSR-17 compliant - no more dependency on one specific HTTP Client!
  • 🎉 Dependency-injection first - easy usage with all modern frameworks!
  • 🎉 GitHub Actions for Quality Assurance - it just works!
  • 🎉 Single Responsibility - only API communication inside!

Getting started

Riot PHP is available via Composer. It does not implement HTTP Client on its own and uses PSR-17 and PSR-18 abstraction so you are free to choose any HTTP Client you want.

composer require simivar/riot-php symfony/http-client nyholm/psr7

APIs Coverage

⚠️ APIs that have their names strikethrough are deprecated and will be removed.

API Docs Status
Account v1 docs 100%
Champion Mastery v4 docs 100%
Champion v3 docs 100%
Clash v1 docs 100%
League Exp v4 docs 100%
League v4 docs 100%
Lol Status v3 docs 100%
Lol Status v4 docs 100%
Lor Match v1 docs 100%
Lor Ranked v1 docs 100%
Match v4 docs 100%
Spectator v4 docs 100%
Summoner v4 docs 100%
Tft League v1 docs 100%
Tft Match v1 docs 100%
Tft Summoner v1 docs 100%
Third Party Code v4 docs 100%
Tournament Stub v4 docs 100%
Tournament v4 docs 100%
Val Content v1 docs 100%

Usage

<?php

require_once('vendor/autoload.php');

$httpClient = new \Symfony\Component\HttpClient\Psr18Client();
$connection = new \Riot\Connection(
    $httpClient,
    'PASTE-YOUR-API-KEY-HERE',
    $httpClient,
    $httpClient
);
$riotApi = new \Riot\API($connection);
$lolStatus = $riotApi->getVersion4()
    ->getLolStatus()
    ->getPlatformData(\Riot\Enum\RegionEnum::EUN1())
    ;

Legal notice

Riot PHP isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc.