diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b1154f8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +composer.lock +.env.test +.idea +vendor +gen + diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..a4deb3c --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Michal Baumgartner + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..f2009e5 --- /dev/null +++ b/README.md @@ -0,0 +1,101 @@ +# LeagueWrap +Simple yet powerful PHP wrapper for [Riot Games API](https://developer.riotgames.com/) (formerly [LeaguePHP/LeagueWrap](https://github.com/LeaguePHP/LeagueWrap) and [paquettg/leaguewrap](https://github.com/paquettg/leaguewrap)). + +The library has been fully rewritten to support v3 of the League of Legends API and adapted to use modern PHP standards such as PSR-4, PSR-6 and PSR-7. Guzzle has been removed in favor of [PHP-HTTP](http://docs.php-http.org/en/latest/), while the caching and rate-limiting backends now fully support PSR-6 through [PHP Cache](http://www.php-cache.com/en/latest/). + +- [Features](#features) +- [Example](#example) +- [Rate limiting and Caching](#rate-limiting-and-caching) +- [Extras](#extras) + - [Additional headers](#additional-headers) +- [Gotchas](#gotchas) + - [Batch request calls / caching](#batch-request-calls-caching) +- [Todo](#todo) + +## Features + +* Simple API design + * leverages PHP's magic methods and provides phpdoc annotations + * implements `ArrayAccess` and "dot notation" to quickly grab data +* Rate limiting supports app and method limits +* PSR-6 compatible caching with multiple backend adapters and framework integrations +* Batch calls - every method can accept an array of identifiers to generate multiple asynchronous requests + +## Example + +```php +use LeagueWrap\Client as RiotApi; + +$api = new RiotApi('RGAPI-xxx', 'euw'); + +// The following calls produce the same results +$api->match()->getById($id); +$api->match()->byId($id); + +// Support for batch calls (requires multiple async requests) +$api->match()->getById([$gameId, $anotherGameId]); // using array as an argument +$api->match()->byIds([$gameId, $anotherGameId]); // dedicated method on the Match API Class + +// Simple data access +$myGame = $api->match()->byId($id); +$myGame['gameId'] === $id; +$myGame['teams.0.teamId'] === 100; // "dot" notation support for nested elements +``` + +## Rate limiting +Any PSR-6 compatible cache pool can be used for rate limiting backend. If no pool is supplied, the filesystem is used. For list of available pools see [php-cache docs](http://www.php-cache.com/en/latest/#cache-pool-implementations). + +```php +// Redis backend with Predis client +// @see https://github.com/php-cache/predis-adapter +$client = new \Predis\Client('tcp:/127.0.0.1:6379'); +$pool = new \Cache\Adapter\Predis\PredisCachePool($client); + +$api->setAppLimits([ + '10' => 100, // 100 requests per 10 seconds +], $pool); + +// When using Laravel +$store = app(\Illuminate\Cache\Repository::class)->getStore(); +$pool = new \Cache\Adapter\Illuminate\IlluminateCachePool($store); + +$api->setLimits([ + '10' => 100, // 100 requests per 10 seconds +], $pool); + +/* + * Caching is very similar, infact the same pool can be shared with the rate-limiter. + */ +$api->addCache($pool); +$api->removeCache(); +``` + +## Extras + +### Additional headers +The underlying PSR response contains additional headers such as: +* `X-Region` - region string, can be used with `Region::create($value)` +* `X-Endpoint` - endpoint name, can be used with `BaseApi::$endpointDefinitions[$endpointName]` + +## Gotchas + +### Batch request calls / caching +Consider the following example: +```php +$api->addCache($cachePool)->match()->byIds([$id1, $id2, ..., $idN, $id1]); +``` +it is possible that `N+1` requests will be made instead of `N` (where the second call with `$id1` would be cached) because Guzzle can start multiple requests "concurrently", therefore the second call would be fired before the first response could be received and cached. + +This scenario is not that significant in most cases as requesting multiple same resources should be avoided in the application logic. + +## Todo + +* Finish writing annotations for phpdoc +* Custom cache TTL for individual endpoints +* Sync rate limits and usage from responses +* Clean up batch responses sorting +* Dto support? +* Should the filesystem cache be used by default or use void? + +--- +PHP LeagueWrap API isn't endorsed by LeagueWrap Games and doesn't reflect the views or opinions of LeagueWrap Games or anyone officially involved in producing or managing League of Legends. League of Legends and LeagueWrap Games are trademarks or registered trademarks of LeagueWrap Games, Inc. League of Legends © LeagueWrap Games, Inc. diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..98e4863 --- /dev/null +++ b/composer.json @@ -0,0 +1,42 @@ +{ + "name": "m1so/leaguewrap", + "description": "Riot Games API client", + "license": "MIT", + "keywords": ["leaguewrap", "lol", "league", "riot", "rito", "games", "legends", "api"], + "authors": [ + { + "name": "Michal Baumgartner", + "email": "michal@baumgartner.io" + } + ], + "autoload": { + "psr-4": { + "LeagueWrap\\": "src/LeagueWrap" + } + }, + "autoload-dev": { + "psr-4": { + "LeagueWrap\\Tests\\": "tests" + } + }, + "require": { + "php": "^5.6 || ^7.0", + "psr/http-message": "^1.0", + "cache/cache": "^1.0", + "php-http/httplug": "^1.1", + "php-http/discovery": "^1.0", + "php-http/client-implementation": "^1.0", + "php-http/client-common": "^1.3", + "php-http/cache-plugin": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^6.1", + "brianium/paratest": "dev-master", + "vlucas/phpdotenv": "^2.4.0", + "php-http/guzzle6-adapter": "^1.0", + "php-http/mock-client": "^1.0" + }, + "scripts": { + "test-int": "paratest -p8 -f --testsuite Integration --bootstrap tests/bootstrap.php --colors tests" + } +} diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..601c4a2 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,26 @@ + + + + + ./tests/Unit + + + + ./tests/Integration + + + + + + src + + + diff --git a/src/LeagueWrap/Api/BaseApi.php b/src/LeagueWrap/Api/BaseApi.php new file mode 100644 index 0000000..cfbe3c6 --- /dev/null +++ b/src/LeagueWrap/Api/BaseApi.php @@ -0,0 +1,205 @@ +client = $client; + $this->region = $region; + + if (count(self::$endpointClasses) === 0 && count(self::$endpointDefinitions) === 0) { + $this->loadAllEndpoints(); + } + } + + /** + * @param \LeagueWrap\Api\Endpoint $endpoint + * @param array $options + * + * @return \Psr\Http\Message\RequestInterface + */ + protected function buildRequest(Endpoint $endpoint, $options = []) + { + $uri = UriFactoryDiscovery::find()->createUri($endpoint->getUrl()); + + return MessageFactoryDiscovery::find() + ->createRequest( + 'GET', + count($options) > 0 ? $uri->withQuery(preg_replace('/%5B[0-9]+%5D/simU', '', http_build_query($options))) : $uri + ) + ->withHeader('X-Endpoint', $endpoint->getName()) + ->withHeader('X-Region', $endpoint->getRegion()->getName()); + } + + /** + * Perform one or more async requests. + * + * @param Endpoint[] $endpoints + * @param array $params + * + * @return Result|BatchResult + */ + protected function getAsync(array $endpoints, $params = []) + { + /** @var Promise[] $promises */ + $promises = array_map(function (Endpoint $endpoint) use ($params) { + $isCached = $this->client->getCache() && $this->client->getCache()->getItem(KeyGenerator::fromEndpoint($endpoint))->isHit(); + + if ($endpoint->countsTowardsLimit() && !$isCached) { + try { + $this->client->getMethodRateLimiter()->hit($endpoint); + $this->client->getAppRateLimiter()->hit($endpoint); + } catch (RateLimitReachedException $e) { + return new RejectedPromise($e); + } + } + + return $this->client->getHttpClient() + ->sendAsyncRequest($this->buildRequest($endpoint, $params)) + ->then(function (ResponseInterface $response) use ($endpoint) { + return $response + ->withHeader('X-Endpoint', $endpoint->getName()) + ->withHeader('X-Region', $endpoint->getRegion()->getName()); + }); + }, is_array($endpoints) ? $endpoints : [$endpoints]); + + // Wait for multiple requests to complete, even if some fail + if (count($promises) > 1) { + $results = \GuzzleHttp\Promise\settle($promises)->wait(); + + return BatchResult::fromSettledPromises($results); + } + + // Resolve a single request + $result = $promises[0]->wait(); + + if (! $result instanceof ResponseInterface) { + throw $result; + } + + return Result::fromPsr7($result); + } + + protected function createEndpointsFromIds($ids, $endpointClass, $additionalArguments = []) + { + return array_map(function ($id) use ($endpointClass, $additionalArguments) { + $identifiers = $additionalArguments; + $identifiers[0] = $id; + + return new $endpointClass($this->region, $identifiers); + }, is_array($ids) ? $ids : [$ids]); + } + + /** + * Load all available endpoints as an array of full class names with namespace strings. + * The endpoints are contained within a folder structure that is only 1 level deep. + */ + private function loadAllEndpoints() + { + self::$endpointClasses = array_map(function ($classPath) { + // For ./Api/Endpoints/MatchById -> ('MatchById.php') + list($endpointClass) = array_slice(explode('/', $classPath), -1, 1); + + // Build the full class name with namespace + $fullClassName = join('\\', [__NAMESPACE__, 'Endpoints', str_replace('.php', '', $endpointClass)]); + + /** @var Endpoint $endpoint */ + $endpoint = new $fullClassName($this->region); + + self::$endpointDefinitions[$endpoint->getName()] = [ + 'class' => $fullClassName, + 'instance' => $endpoint, + ]; + + return $fullClassName; + }, glob(__DIR__.'/Endpoints/*.php')); + } + + /** + * Magic™ method to access all v3 endpoints. + * + * @param $name + * @param $arguments + * + * @throws \Exception + * + * @return Result|BatchResult + */ + public function __call($name, $arguments) + { + $namespacedClassName = get_class($this); + + // Convert current class name to class name without the namespace part + $class = ($pos = strrpos($namespacedClassName, '\\')) ? substr($namespacedClassName, $pos + 1) : $pos; + + // Call the endpoint either by 'Match::getById' or by 'Match::byId' + $name = substr($name, 0, 3) === 'get' ? substr_replace($name, $class, 0, 3) : $name; + $name = strpos(strtolower($name), strtolower($class)) !== false ? $name : $class.$name; + + // Build up the namespace + class name for the endpoint ($class refers to the category here) + $endpointClass = join('\\', array_filter([__NAMESPACE__, 'Endpoints', $name])); + + // Check if the requested endpoint is actually implemented + if (! is_subclass_of($endpointClass, Endpoint::class)) { + throw new \Exception("Class '{$endpointClass}' is not a subclass of 'Endpoint'. Undefined method called: {$namespacedClassName}::{$name}"); + } + + // Argument parsing + $argCount = count($arguments); + $hasOptions = $argCount > 1 && is_array($arguments[$argCount - 1]); + $options = $hasOptions ? $arguments[count($arguments) - 1] : []; + $ids = array_slice($arguments, 1, $argCount - 1, true); + + return $this->getAsync( + $this->createEndpointsFromIds($arguments[0], $endpointClass, $ids), + $options + ); + } +} diff --git a/src/LeagueWrap/Api/BaseDto.php b/src/LeagueWrap/Api/BaseDto.php new file mode 100644 index 0000000..f45921d --- /dev/null +++ b/src/LeagueWrap/Api/BaseDto.php @@ -0,0 +1,8 @@ +ids = $ids; + $this->region = $region; + } + + /** + * Endpoint's name. + * + * @return string + */ + public function getName() + { + // str_replace(['/', '{', '}'], ['_', '', ''], $this->urlTemplate) + return $this->urlTemplate; + } + + /** + * Get url of this endpoint with formatted parameters. + * + * @return string + */ + public function getUrl() + { + return $this->formatUrlWith($this->ids, $this->urlTemplate); + } + + /** + * Replaces all {templateLiterals} with values from the params array in given string. + * + * @param $ids + * @param $urlTemplate + * + * @return string + */ + protected function formatUrlWith($ids, $urlTemplate) + { + // Already computed + if ($this->url) { + return $this->url; + } + + $url = $urlTemplate; + + foreach ($ids as $id) { + $url = preg_replace('/{[^}]+}/', $id, $url, 1); + } + + // Update once the replacement process is complete + $this->url = $url; + + return $url; + } + + /** + * Rate limit as an associative array. + * + * @return array + */ + public function getLimit() + { + return $this->rateLimit; + } + + /** + * {@inheritdoc} + */ + public function countsTowardsLimit() + { + return $this->isRateLimited; + } + + /** + * {@inheritdoc} + */ + public function getRegion() + { + return $this->region; + } + + /** + * {@inheritdoc} + */ + public function getCacheLifeTime() + { + return $this->cacheLifeTime; + } +} diff --git a/src/LeagueWrap/Api/ChampionMastery.php b/src/LeagueWrap/Api/ChampionMastery.php new file mode 100644 index 0000000..8f8a566 --- /dev/null +++ b/src/LeagueWrap/Api/ChampionMastery.php @@ -0,0 +1,11 @@ +pickTurn; + } + + /** + * @return double + */ + public function getChampionId() + { + return $this->championId; + } + + /** + * @return double + */ + public function getTeamId() + { + return $this->teamId; + } + + /** + * @param int $pickTurn + * + * @return $this + */ + public function setPickTurn($pickTurn) + { + $this->pickTurn = $pickTurn; + + return $this; + } + + /** + * @param double $championId + * + * @return $this + */ + public function setChampionId($championId) + { + $this->championId = $championId; + + return $this; + } + + /** + * @param double $teamId + * + * @return $this + */ + public function setTeamId($teamId) + { + $this->teamId = $teamId; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/BlockDto.php b/src/LeagueWrap/Api/Dto/BlockDto.php new file mode 100644 index 0000000..27f8716 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/BlockDto.php @@ -0,0 +1,85 @@ +items; + } + + /** + * @return bool + */ + public function isRecMath() + { + return $this->recMath; + } + + /** + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * @param BlockItemDto[] $items + * + * @return $this + */ + public function setItems($items) + { + foreach ($items as $key => $dtoData) { + $this->items[$key] = new BlockItemDto($dtoData); + } + + return $this; + } + + /** + * @param bool $recMath + * + * @return $this + */ + public function setRecMath($recMath) + { + $this->recMath = $recMath; + + return $this; + } + + /** + * @param string $type + * + * @return $this + */ + public function setType($type) + { + $this->type = $type; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/BlockItemDto.php b/src/LeagueWrap/Api/Dto/BlockItemDto.php new file mode 100644 index 0000000..7274cd7 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/BlockItemDto.php @@ -0,0 +1,60 @@ +count; + } + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @param int $count + * + * @return $this + */ + public function setCount($count) + { + $this->count = $count; + + return $this; + } + + /** + * @param int $id + * + * @return $this + */ + public function setId($id) + { + $this->id = $id; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/ChampionDto.php b/src/LeagueWrap/Api/Dto/ChampionDto.php new file mode 100644 index 0000000..8fe73e7 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/ChampionDto.php @@ -0,0 +1,411 @@ +info; + } + + /** + * @return string[] + */ + public function getEnemytips() + { + return $this->enemytips; + } + + /** + * @return StatsDto + */ + public function getStats() + { + return $this->stats; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * @return ImageDto + */ + public function getImage() + { + return $this->image; + } + + /** + * @return string[] + */ + public function getTags() + { + return $this->tags; + } + + /** + * @return string + */ + public function getPartype() + { + return $this->partype; + } + + /** + * @return SkinDto[] + */ + public function getSkins() + { + return $this->skins; + } + + /** + * @return PassiveDto + */ + public function getPassive() + { + return $this->passive; + } + + /** + * @return RecommendedDto[] + */ + public function getRecommended() + { + return $this->recommended; + } + + /** + * @return string[] + */ + public function getAllytips() + { + return $this->allytips; + } + + /** + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * @return string + */ + public function getLore() + { + return $this->lore; + } + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @return string + */ + public function getBlurb() + { + return $this->blurb; + } + + /** + * @return ChampionSpellDto[] + */ + public function getSpells() + { + return $this->spells; + } + + /** + * @param InfoDto $info + * + * @return $this + */ + public function setInfo($info) + { + $this->info = new InfoDto($info); + + return $this; + } + + /** + * @param string[] $enemytips + * + * @return $this + */ + public function setEnemytips($enemytips) + { + $this->enemytips = $enemytips; + + return $this; + } + + /** + * @param StatsDto $stats + * + * @return $this + */ + public function setStats($stats) + { + $this->stats = new StatsDto($stats); + + return $this; + } + + /** + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * @param string $title + * + * @return $this + */ + public function setTitle($title) + { + $this->title = $title; + + return $this; + } + + /** + * @param ImageDto $image + * + * @return $this + */ + public function setImage($image) + { + $this->image = new ImageDto($image); + + return $this; + } + + /** + * @param string[] $tags + * + * @return $this + */ + public function setTags($tags) + { + $this->tags = $tags; + + return $this; + } + + /** + * @param string $partype + * + * @return $this + */ + public function setPartype($partype) + { + $this->partype = $partype; + + return $this; + } + + /** + * @param SkinDto[] $skins + * + * @return $this + */ + public function setSkins($skins) + { + foreach ($skins as $key => $dtoData) { + $this->skins[$key] = new SkinDto($dtoData); + } + + return $this; + } + + /** + * @param PassiveDto $passive + * + * @return $this + */ + public function setPassive($passive) + { + $this->passive = new PassiveDto($passive); + + return $this; + } + + /** + * @param RecommendedDto[] $recommended + * + * @return $this + */ + public function setRecommended($recommended) + { + foreach ($recommended as $key => $dtoData) { + $this->recommended[$key] = new RecommendedDto($dtoData); + } + + return $this; + } + + /** + * @param string[] $allytips + * + * @return $this + */ + public function setAllytips($allytips) + { + $this->allytips = $allytips; + + return $this; + } + + /** + * @param string $key + * + * @return $this + */ + public function setKey($key) + { + $this->key = $key; + + return $this; + } + + /** + * @param string $lore + * + * @return $this + */ + public function setLore($lore) + { + $this->lore = $lore; + + return $this; + } + + /** + * @param int $id + * + * @return $this + */ + public function setId($id) + { + $this->id = $id; + + return $this; + } + + /** + * @param string $blurb + * + * @return $this + */ + public function setBlurb($blurb) + { + $this->blurb = $blurb; + + return $this; + } + + /** + * @param ChampionSpellDto[] $spells + * + * @return $this + */ + public function setSpells($spells) + { + foreach ($spells as $key => $dtoData) { + $this->spells[$key] = new ChampionSpellDto($dtoData); + } + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/ChampionListDto.php b/src/LeagueWrap/Api/Dto/ChampionListDto.php new file mode 100644 index 0000000..93f0cd3 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/ChampionListDto.php @@ -0,0 +1,131 @@ +keys; + } + + /** + * @return ChampionDto[] + */ + public function getData() + { + return $this->data; + } + + /** + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * @return string + */ + public function getFormat() + { + return $this->format; + } + + /** + * @param string[] $keys Map[string, string] + * + * @return $this + */ + public function setKeys($keys) + { + $this->keys = $keys; + + return $this; + } + + /** + * @param ChampionDto[] $data Map[string, ChampionDto] + * + * @return $this + */ + public function setData($data) + { + foreach ($data as $key => $dtoData) { + $this->data[$key] = new ChampionDto($dtoData); + } + + return $this; + } + + /** + * @param string $version + * + * @return $this + */ + public function setVersion($version) + { + $this->version = $version; + + return $this; + } + + /** + * @param string $type + * + * @return $this + */ + public function setType($type) + { + $this->type = $type; + + return $this; + } + + /** + * @param string $format + * + * @return $this + */ + public function setFormat($format) + { + $this->format = $format; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/ChampionMasteryDto.php b/src/LeagueWrap/Api/Dto/ChampionMasteryDto.php new file mode 100644 index 0000000..cc43ee9 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/ChampionMasteryDto.php @@ -0,0 +1,198 @@ +chestGranted; + } + + /** + * @return int + */ + public function getChampionLevel() + { + return $this->championLevel; + } + + /** + * @return int + */ + public function getChampionPoints() + { + return $this->championPoints; + } + + /** + * @return double + */ + public function getChampionId() + { + return $this->championId; + } + + /** + * @return double + */ + public function getPlayerId() + { + return $this->playerId; + } + + /** + * @return double + */ + public function getChampionPointsUntilNextLevel() + { + return $this->championPointsUntilNextLevel; + } + + /** + * @return double + */ + public function getChampionPointsSinceLastLevel() + { + return $this->championPointsSinceLastLevel; + } + + /** + * @return double + */ + public function getLastPlayTime() + { + return $this->lastPlayTime; + } + + /** + * @param bool $chestGranted + * + * @return $this + */ + public function setChestGranted($chestGranted) + { + $this->chestGranted = $chestGranted; + + return $this; + } + + /** + * @param int $championLevel + * + * @return $this + */ + public function setChampionLevel($championLevel) + { + $this->championLevel = $championLevel; + + return $this; + } + + /** + * @param int $championPoints + * + * @return $this + */ + public function setChampionPoints($championPoints) + { + $this->championPoints = $championPoints; + + return $this; + } + + /** + * @param double $championId + * + * @return $this + */ + public function setChampionId($championId) + { + $this->championId = $championId; + + return $this; + } + + /** + * @param double $playerId + * + * @return $this + */ + public function setPlayerId($playerId) + { + $this->playerId = $playerId; + + return $this; + } + + /** + * @param double $championPointsUntilNextLevel + * + * @return $this + */ + public function setChampionPointsUntilNextLevel($championPointsUntilNextLevel) + { + $this->championPointsUntilNextLevel = $championPointsUntilNextLevel; + + return $this; + } + + /** + * @param double $championPointsSinceLastLevel + * + * @return $this + */ + public function setChampionPointsSinceLastLevel($championPointsSinceLastLevel) + { + $this->championPointsSinceLastLevel = $championPointsSinceLastLevel; + + return $this; + } + + /** + * @param double $lastPlayTime + * + * @return $this + */ + public function setLastPlayTime($lastPlayTime) + { + $this->lastPlayTime = $lastPlayTime; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/ChampionSpellDto.php b/src/LeagueWrap/Api/Dto/ChampionSpellDto.php new file mode 100644 index 0000000..bd19f0f --- /dev/null +++ b/src/LeagueWrap/Api/Dto/ChampionSpellDto.php @@ -0,0 +1,501 @@ +cooldownBurn; + } + + /** + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * @return LevelTipDto + */ + public function getLeveltip() + { + return $this->leveltip; + } + + /** + * @return SpellVarsDto[] + */ + public function getVars() + { + return $this->vars; + } + + /** + * @return string + */ + public function getCostType() + { + return $this->costType; + } + + /** + * @return ImageDto + */ + public function getImage() + { + return $this->image; + } + + /** + * @return string + */ + public function getSanitizedDescription() + { + return $this->sanitizedDescription; + } + + /** + * @return string + */ + public function getSanitizedTooltip() + { + return $this->sanitizedTooltip; + } + + /** + * @return object[] + */ + public function getEffect() + { + return $this->effect; + } + + /** + * @return string + */ + public function getTooltip() + { + return $this->tooltip; + } + + /** + * @return int + */ + public function getMaxrank() + { + return $this->maxrank; + } + + /** + * @return string + */ + public function getCostBurn() + { + return $this->costBurn; + } + + /** + * @return string + */ + public function getRangeBurn() + { + return $this->rangeBurn; + } + + /** + * @return object + */ + public function getRange() + { + return $this->range; + } + + /** + * @return double[] + */ + public function getCooldown() + { + return $this->cooldown; + } + + /** + * @return int[] + */ + public function getCost() + { + return $this->cost; + } + + /** + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * @return string[] + */ + public function getEffectBurn() + { + return $this->effectBurn; + } + + /** + * @return ImageDto[] + */ + public function getAltimages() + { + return $this->altimages; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @param string $cooldownBurn + * + * @return $this + */ + public function setCooldownBurn($cooldownBurn) + { + $this->cooldownBurn = $cooldownBurn; + + return $this; + } + + /** + * @param string $resource + * + * @return $this + */ + public function setResource($resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param LevelTipDto $leveltip + * + * @return $this + */ + public function setLeveltip($leveltip) + { + $this->leveltip = new LevelTipDto($leveltip); + + return $this; + } + + /** + * @param SpellVarsDto[] $vars + * + * @return $this + */ + public function setVars($vars) + { + foreach ($vars as $key => $dtoData) { + $this->vars[$key] = new SpellVarsDto($dtoData); + } + + return $this; + } + + /** + * @param string $costType + * + * @return $this + */ + public function setCostType($costType) + { + $this->costType = $costType; + + return $this; + } + + /** + * @param ImageDto $image + * + * @return $this + */ + public function setImage($image) + { + $this->image = new ImageDto($image); + + return $this; + } + + /** + * @param string $sanitizedDescription + * + * @return $this + */ + public function setSanitizedDescription($sanitizedDescription) + { + $this->sanitizedDescription = $sanitizedDescription; + + return $this; + } + + /** + * @param string $sanitizedTooltip + * + * @return $this + */ + public function setSanitizedTooltip($sanitizedTooltip) + { + $this->sanitizedTooltip = $sanitizedTooltip; + + return $this; + } + + /** + * @param object[] $effect + * + * @return $this + */ + public function setEffect($effect) + { + $this->effect = $effect; + + return $this; + } + + /** + * @param string $tooltip + * + * @return $this + */ + public function setTooltip($tooltip) + { + $this->tooltip = $tooltip; + + return $this; + } + + /** + * @param int $maxrank + * + * @return $this + */ + public function setMaxrank($maxrank) + { + $this->maxrank = $maxrank; + + return $this; + } + + /** + * @param string $costBurn + * + * @return $this + */ + public function setCostBurn($costBurn) + { + $this->costBurn = $costBurn; + + return $this; + } + + /** + * @param string $rangeBurn + * + * @return $this + */ + public function setRangeBurn($rangeBurn) + { + $this->rangeBurn = $rangeBurn; + + return $this; + } + + /** + * @param object $range + * + * @return $this + */ + public function setRange($range) + { + $this->range = $range; + + return $this; + } + + /** + * @param double[] $cooldown + * + * @return $this + */ + public function setCooldown($cooldown) + { + $this->cooldown = $cooldown; + + return $this; + } + + /** + * @param int[] $cost + * + * @return $this + */ + public function setCost($cost) + { + $this->cost = $cost; + + return $this; + } + + /** + * @param string $key + * + * @return $this + */ + public function setKey($key) + { + $this->key = $key; + + return $this; + } + + /** + * @param string $description + * + * @return $this + */ + public function setDescription($description) + { + $this->description = $description; + + return $this; + } + + /** + * @param string[] $effectBurn + * + * @return $this + */ + public function setEffectBurn($effectBurn) + { + $this->effectBurn = $effectBurn; + + return $this; + } + + /** + * @param ImageDto[] $altimages + * + * @return $this + */ + public function setAltimages($altimages) + { + foreach ($altimages as $key => $dtoData) { + $this->altimages[$key] = new ImageDto($dtoData); + } + + return $this; + } + + /** + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/CurrentGameInfo.php b/src/LeagueWrap/Api/Dto/CurrentGameInfo.php new file mode 100644 index 0000000..9792f77 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/CurrentGameInfo.php @@ -0,0 +1,267 @@ +gameId; + } + + /** + * @return double + */ + public function getGameStartTime() + { + return $this->gameStartTime; + } + + /** + * @return string + */ + public function getPlatformId() + { + return $this->platformId; + } + + /** + * @return Enum\GameMode::CLASSIC|Enum\GameMode::ODIN|Enum\GameMode::ARAM|Enum\GameMode::TUTORIAL|Enum\GameMode::ONEFORALL|Enum\GameMode::ASCENSION|Enum\GameMode::FIRSTBLOOD|Enum\GameMode::KINGPORO|Enum\GameMode::SIEGE|Enum\GameMode::ASSASSINATE|Enum\GameMode::ARSR|Enum\GameMode::DARKSTAR + */ + public function getGameMode() + { + return $this->gameMode; + } + + /** + * @return double + */ + public function getMapId() + { + return $this->mapId; + } + + /** + * @return Enum\GameType::CUSTOM_GAME|Enum\GameType::TUTORIAL_GAME|Enum\GameType::MATCHED_GAME + */ + public function getGameType() + { + return $this->gameType; + } + + /** + * @return BannedChampion[] + */ + public function getBannedChampions() + { + return $this->bannedChampions; + } + + /** + * @return Observer + */ + public function getObservers() + { + return $this->observers; + } + + /** + * @return CurrentGameParticipant[] + */ + public function getParticipants() + { + return $this->participants; + } + + /** + * @return double + */ + public function getGameLength() + { + return $this->gameLength; + } + + /** + * @return double + */ + public function getGameQueueConfigId() + { + return $this->gameQueueConfigId; + } + + /** + * @param double $gameId + * + * @return $this + */ + public function setGameId($gameId) + { + $this->gameId = $gameId; + + return $this; + } + + /** + * @param double $gameStartTime + * + * @return $this + */ + public function setGameStartTime($gameStartTime) + { + $this->gameStartTime = $gameStartTime; + + return $this; + } + + /** + * @param string $platformId + * + * @return $this + */ + public function setPlatformId($platformId) + { + $this->platformId = $platformId; + + return $this; + } + + /** + * @param Enum\GameMode::CLASSIC|Enum\GameMode::ODIN|Enum\GameMode::ARAM|Enum\GameMode::TUTORIAL|Enum\GameMode::ONEFORALL|Enum\GameMode::ASCENSION|Enum\GameMode::FIRSTBLOOD|Enum\GameMode::KINGPORO|Enum\GameMode::SIEGE|Enum\GameMode::ASSASSINATE|Enum\GameMode::ARSR|Enum\GameMode::DARKSTAR $gameMode + * + * @return $this + */ + public function setGameMode($gameMode) + { + $this->gameMode = $gameMode; + + return $this; + } + + /** + * @param double $mapId + * + * @return $this + */ + public function setMapId($mapId) + { + $this->mapId = $mapId; + + return $this; + } + + /** + * @param Enum\GameType::CUSTOM_GAME|Enum\GameType::TUTORIAL_GAME|Enum\GameType::MATCHED_GAME $gameType + * + * @return $this + */ + public function setGameType($gameType) + { + $this->gameType = $gameType; + + return $this; + } + + /** + * @param BannedChampion[] $bannedChampions + * + * @return $this + */ + public function setBannedChampions($bannedChampions) + { + $this->bannedChampions = $bannedChampions; + + return $this; + } + + /** + * @param Observer $observers + * + * @return $this + */ + public function setObservers($observers) + { + $this->observers = $observers; + + return $this; + } + + /** + * @param CurrentGameParticipant[] $participants + * + * @return $this + */ + public function setParticipants($participants) + { + $this->participants = $participants; + + return $this; + } + + /** + * @param double $gameLength + * + * @return $this + */ + public function setGameLength($gameLength) + { + $this->gameLength = $gameLength; + + return $this; + } + + /** + * @param double $gameQueueConfigId + * + * @return $this + */ + public function setGameQueueConfigId($gameQueueConfigId) + { + $this->gameQueueConfigId = $gameQueueConfigId; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/CurrentGameParticipant.php b/src/LeagueWrap/Api/Dto/CurrentGameParticipant.php new file mode 100644 index 0000000..3edfd28 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/CurrentGameParticipant.php @@ -0,0 +1,244 @@ +profileIconId; + } + + /** + * @return double + */ + public function getChampionId() + { + return $this->championId; + } + + /** + * @return string + */ + public function getSummonerName() + { + return $this->summonerName; + } + + /** + * @return Rune[] + */ + public function getRunes() + { + return $this->runes; + } + + /** + * @return bool + */ + public function isBot() + { + return $this->bot; + } + + /** + * @return double + */ + public function getTeamId() + { + return $this->teamId; + } + + /** + * @return double + */ + public function getSpell2Id() + { + return $this->spell2Id; + } + + /** + * @return Mastery[] + */ + public function getMasteries() + { + return $this->masteries; + } + + /** + * @return double + */ + public function getSpell1Id() + { + return $this->spell1Id; + } + + /** + * @return double + */ + public function getSummonerId() + { + return $this->summonerId; + } + + /** + * @param double $profileIconId + * + * @return $this + */ + public function setProfileIconId($profileIconId) + { + $this->profileIconId = $profileIconId; + + return $this; + } + + /** + * @param double $championId + * + * @return $this + */ + public function setChampionId($championId) + { + $this->championId = $championId; + + return $this; + } + + /** + * @param string $summonerName + * + * @return $this + */ + public function setSummonerName($summonerName) + { + $this->summonerName = $summonerName; + + return $this; + } + + /** + * @param Rune[] $runes + * + * @return $this + */ + public function setRunes($runes) + { + $this->runes = $runes; + + return $this; + } + + /** + * @param bool $bot + * + * @return $this + */ + public function setBot($bot) + { + $this->bot = $bot; + + return $this; + } + + /** + * @param double $teamId + * + * @return $this + */ + public function setTeamId($teamId) + { + $this->teamId = $teamId; + + return $this; + } + + /** + * @param double $spell2Id + * + * @return $this + */ + public function setSpell2Id($spell2Id) + { + $this->spell2Id = $spell2Id; + + return $this; + } + + /** + * @param Mastery[] $masteries + * + * @return $this + */ + public function setMasteries($masteries) + { + $this->masteries = $masteries; + + return $this; + } + + /** + * @param double $spell1Id + * + * @return $this + */ + public function setSpell1Id($spell1Id) + { + $this->spell1Id = $spell1Id; + + return $this; + } + + /** + * @param double $summonerId + * + * @return $this + */ + public function setSummonerId($summonerId) + { + $this->summonerId = $summonerId; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/FeaturedGameInfo.php b/src/LeagueWrap/Api/Dto/FeaturedGameInfo.php new file mode 100644 index 0000000..5e22ccf --- /dev/null +++ b/src/LeagueWrap/Api/Dto/FeaturedGameInfo.php @@ -0,0 +1,267 @@ +gameId; + } + + /** + * @return double + */ + public function getGameStartTime() + { + return $this->gameStartTime; + } + + /** + * @return string + */ + public function getPlatformId() + { + return $this->platformId; + } + + /** + * @return Enum\GameMode::CLASSIC|Enum\GameMode::ODIN|Enum\GameMode::ARAM|Enum\GameMode::TUTORIAL|Enum\GameMode::ONEFORALL|Enum\GameMode::ASCENSION|Enum\GameMode::FIRSTBLOOD|Enum\GameMode::KINGPORO|Enum\GameMode::SIEGE|Enum\GameMode::ASSASSINATE|Enum\GameMode::ARSR|Enum\GameMode::DARKSTAR + */ + public function getGameMode() + { + return $this->gameMode; + } + + /** + * @return double + */ + public function getMapId() + { + return $this->mapId; + } + + /** + * @return Enum\GameType::CUSTOM_GAME|Enum\GameType::TUTORIAL_GAME|Enum\GameType::MATCHED_GAME + */ + public function getGameType() + { + return $this->gameType; + } + + /** + * @return BannedChampion[] + */ + public function getBannedChampions() + { + return $this->bannedChampions; + } + + /** + * @return Observer + */ + public function getObservers() + { + return $this->observers; + } + + /** + * @return Participant[] + */ + public function getParticipants() + { + return $this->participants; + } + + /** + * @return double + */ + public function getGameLength() + { + return $this->gameLength; + } + + /** + * @return double + */ + public function getGameQueueConfigId() + { + return $this->gameQueueConfigId; + } + + /** + * @param double $gameId + * + * @return $this + */ + public function setGameId($gameId) + { + $this->gameId = $gameId; + + return $this; + } + + /** + * @param double $gameStartTime + * + * @return $this + */ + public function setGameStartTime($gameStartTime) + { + $this->gameStartTime = $gameStartTime; + + return $this; + } + + /** + * @param string $platformId + * + * @return $this + */ + public function setPlatformId($platformId) + { + $this->platformId = $platformId; + + return $this; + } + + /** + * @param Enum\GameMode::CLASSIC|Enum\GameMode::ODIN|Enum\GameMode::ARAM|Enum\GameMode::TUTORIAL|Enum\GameMode::ONEFORALL|Enum\GameMode::ASCENSION|Enum\GameMode::FIRSTBLOOD|Enum\GameMode::KINGPORO|Enum\GameMode::SIEGE|Enum\GameMode::ASSASSINATE|Enum\GameMode::ARSR|Enum\GameMode::DARKSTAR $gameMode + * + * @return $this + */ + public function setGameMode($gameMode) + { + $this->gameMode = $gameMode; + + return $this; + } + + /** + * @param double $mapId + * + * @return $this + */ + public function setMapId($mapId) + { + $this->mapId = $mapId; + + return $this; + } + + /** + * @param Enum\GameType::CUSTOM_GAME|Enum\GameType::TUTORIAL_GAME|Enum\GameType::MATCHED_GAME $gameType + * + * @return $this + */ + public function setGameType($gameType) + { + $this->gameType = $gameType; + + return $this; + } + + /** + * @param BannedChampion[] $bannedChampions + * + * @return $this + */ + public function setBannedChampions($bannedChampions) + { + $this->bannedChampions = $bannedChampions; + + return $this; + } + + /** + * @param Observer $observers + * + * @return $this + */ + public function setObservers($observers) + { + $this->observers = $observers; + + return $this; + } + + /** + * @param Participant[] $participants + * + * @return $this + */ + public function setParticipants($participants) + { + $this->participants = $participants; + + return $this; + } + + /** + * @param double $gameLength + * + * @return $this + */ + public function setGameLength($gameLength) + { + $this->gameLength = $gameLength; + + return $this; + } + + /** + * @param double $gameQueueConfigId + * + * @return $this + */ + public function setGameQueueConfigId($gameQueueConfigId) + { + $this->gameQueueConfigId = $gameQueueConfigId; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/FeaturedGames.php b/src/LeagueWrap/Api/Dto/FeaturedGames.php new file mode 100644 index 0000000..41200e0 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/FeaturedGames.php @@ -0,0 +1,60 @@ +clientRefreshInterval; + } + + /** + * @return FeaturedGameInfo[] + */ + public function getGameList() + { + return $this->gameList; + } + + /** + * @param double $clientRefreshInterval + * + * @return $this + */ + public function setClientRefreshInterval($clientRefreshInterval) + { + $this->clientRefreshInterval = $clientRefreshInterval; + + return $this; + } + + /** + * @param FeaturedGameInfo[] $gameList + * + * @return $this + */ + public function setGameList($gameList) + { + $this->gameList = $gameList; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/GoldDto.php b/src/LeagueWrap/Api/Dto/GoldDto.php new file mode 100644 index 0000000..10bf3c9 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/GoldDto.php @@ -0,0 +1,106 @@ +sell; + } + + /** + * @return int + */ + public function getTotal() + { + return $this->total; + } + + /** + * @return int + */ + public function getBase() + { + return $this->base; + } + + /** + * @return bool + */ + public function isPurchasable() + { + return $this->purchasable; + } + + /** + * @param int $sell + * + * @return $this + */ + public function setSell($sell) + { + $this->sell = $sell; + + return $this; + } + + /** + * @param int $total + * + * @return $this + */ + public function setTotal($total) + { + $this->total = $total; + + return $this; + } + + /** + * @param int $base + * + * @return $this + */ + public function setBase($base) + { + $this->base = $base; + + return $this; + } + + /** + * @param bool $purchasable + * + * @return $this + */ + public function setPurchasable($purchasable) + { + $this->purchasable = $purchasable; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/GroupDto.php b/src/LeagueWrap/Api/Dto/GroupDto.php new file mode 100644 index 0000000..f4d9c62 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/GroupDto.php @@ -0,0 +1,60 @@ +MaxGroupOwnable; + } + + /** + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * @param string $MaxGroupOwnable + * + * @return $this + */ + public function setMaxGroupOwnable($MaxGroupOwnable) + { + $this->MaxGroupOwnable = $MaxGroupOwnable; + + return $this; + } + + /** + * @param string $key + * + * @return $this + */ + public function setKey($key) + { + $this->key = $key; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/ImageDto.php b/src/LeagueWrap/Api/Dto/ImageDto.php new file mode 100644 index 0000000..3a92a96 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/ImageDto.php @@ -0,0 +1,175 @@ +full; + } + + /** + * @return string + */ + public function getGroup() + { + return $this->group; + } + + /** + * @return string + */ + public function getSprite() + { + return $this->sprite; + } + + /** + * @return int + */ + public function getH() + { + return $this->h; + } + + /** + * @return int + */ + public function getW() + { + return $this->w; + } + + /** + * @return int + */ + public function getY() + { + return $this->y; + } + + /** + * @return int + */ + public function getX() + { + return $this->x; + } + + /** + * @param string $full + * + * @return $this + */ + public function setFull($full) + { + $this->full = $full; + + return $this; + } + + /** + * @param string $group + * + * @return $this + */ + public function setGroup($group) + { + $this->group = $group; + + return $this; + } + + /** + * @param string $sprite + * + * @return $this + */ + public function setSprite($sprite) + { + $this->sprite = $sprite; + + return $this; + } + + /** + * @param int $h + * + * @return $this + */ + public function setH($h) + { + $this->h = $h; + + return $this; + } + + /** + * @param int $w + * + * @return $this + */ + public function setW($w) + { + $this->w = $w; + + return $this; + } + + /** + * @param int $y + * + * @return $this + */ + public function setY($y) + { + $this->y = $y; + + return $this; + } + + /** + * @param int $x + * + * @return $this + */ + public function setX($x) + { + $this->x = $x; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/Incident.php b/src/LeagueWrap/Api/Dto/Incident.php new file mode 100644 index 0000000..0c5fbb1 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/Incident.php @@ -0,0 +1,106 @@ +active; + } + + /** + * @return string + */ + public function getCreated_at() + { + return $this->created_at; + } + + /** + * @return double + */ + public function getId() + { + return $this->id; + } + + /** + * @return Message[] + */ + public function getUpdates() + { + return $this->updates; + } + + /** + * @param bool $active + * + * @return $this + */ + public function setActive($active) + { + $this->active = $active; + + return $this; + } + + /** + * @param string $created_at + * + * @return $this + */ + public function setCreated_at($created_at) + { + $this->created_at = $created_at; + + return $this; + } + + /** + * @param double $id + * + * @return $this + */ + public function setId($id) + { + $this->id = $id; + + return $this; + } + + /** + * @param Message[] $updates + * + * @return $this + */ + public function setUpdates($updates) + { + $this->updates = $updates; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/InfoDto.php b/src/LeagueWrap/Api/Dto/InfoDto.php new file mode 100644 index 0000000..11325c7 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/InfoDto.php @@ -0,0 +1,106 @@ +difficulty; + } + + /** + * @return int + */ + public function getAttack() + { + return $this->attack; + } + + /** + * @return int + */ + public function getDefense() + { + return $this->defense; + } + + /** + * @return int + */ + public function getMagic() + { + return $this->magic; + } + + /** + * @param int $difficulty + * + * @return $this + */ + public function setDifficulty($difficulty) + { + $this->difficulty = $difficulty; + + return $this; + } + + /** + * @param int $attack + * + * @return $this + */ + public function setAttack($attack) + { + $this->attack = $attack; + + return $this; + } + + /** + * @param int $defense + * + * @return $this + */ + public function setDefense($defense) + { + $this->defense = $defense; + + return $this; + } + + /** + * @param int $magic + * + * @return $this + */ + public function setMagic($magic) + { + $this->magic = $magic; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/InventoryDataStatsDto.php b/src/LeagueWrap/Api/Dto/InventoryDataStatsDto.php new file mode 100644 index 0000000..a41f6e6 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/InventoryDataStatsDto.php @@ -0,0 +1,773 @@ +PercentCritDamageMod; + } + + /** + * @return double + */ + public function getPercentSpellBlockMod() + { + return $this->PercentSpellBlockMod; + } + + /** + * @return double + */ + public function getPercentHPRegenMod() + { + return $this->PercentHPRegenMod; + } + + /** + * @return double + */ + public function getPercentMovementSpeedMod() + { + return $this->PercentMovementSpeedMod; + } + + /** + * @return double + */ + public function getFlatSpellBlockMod() + { + return $this->FlatSpellBlockMod; + } + + /** + * @return double + */ + public function getFlatCritDamageMod() + { + return $this->FlatCritDamageMod; + } + + /** + * @return double + */ + public function getFlatEnergyPoolMod() + { + return $this->FlatEnergyPoolMod; + } + + /** + * @return double + */ + public function getPercentLifeStealMod() + { + return $this->PercentLifeStealMod; + } + + /** + * @return double + */ + public function getFlatMPPoolMod() + { + return $this->FlatMPPoolMod; + } + + /** + * @return double + */ + public function getFlatMovementSpeedMod() + { + return $this->FlatMovementSpeedMod; + } + + /** + * @return double + */ + public function getPercentAttackSpeedMod() + { + return $this->PercentAttackSpeedMod; + } + + /** + * @return double + */ + public function getFlatBlockMod() + { + return $this->FlatBlockMod; + } + + /** + * @return double + */ + public function getPercentBlockMod() + { + return $this->PercentBlockMod; + } + + /** + * @return double + */ + public function getFlatEnergyRegenMod() + { + return $this->FlatEnergyRegenMod; + } + + /** + * @return double + */ + public function getPercentSpellVampMod() + { + return $this->PercentSpellVampMod; + } + + /** + * @return double + */ + public function getFlatMPRegenMod() + { + return $this->FlatMPRegenMod; + } + + /** + * @return double + */ + public function getPercentDodgeMod() + { + return $this->PercentDodgeMod; + } + + /** + * @return double + */ + public function getFlatAttackSpeedMod() + { + return $this->FlatAttackSpeedMod; + } + + /** + * @return double + */ + public function getFlatArmorMod() + { + return $this->FlatArmorMod; + } + + /** + * @return double + */ + public function getFlatHPRegenMod() + { + return $this->FlatHPRegenMod; + } + + /** + * @return double + */ + public function getPercentMagicDamageMod() + { + return $this->PercentMagicDamageMod; + } + + /** + * @return double + */ + public function getPercentMPPoolMod() + { + return $this->PercentMPPoolMod; + } + + /** + * @return double + */ + public function getFlatMagicDamageMod() + { + return $this->FlatMagicDamageMod; + } + + /** + * @return double + */ + public function getPercentMPRegenMod() + { + return $this->PercentMPRegenMod; + } + + /** + * @return double + */ + public function getPercentPhysicalDamageMod() + { + return $this->PercentPhysicalDamageMod; + } + + /** + * @return double + */ + public function getFlatPhysicalDamageMod() + { + return $this->FlatPhysicalDamageMod; + } + + /** + * @return double + */ + public function getPercentHPPoolMod() + { + return $this->PercentHPPoolMod; + } + + /** + * @return double + */ + public function getPercentArmorMod() + { + return $this->PercentArmorMod; + } + + /** + * @return double + */ + public function getPercentCritChanceMod() + { + return $this->PercentCritChanceMod; + } + + /** + * @return double + */ + public function getPercentEXPBonus() + { + return $this->PercentEXPBonus; + } + + /** + * @return double + */ + public function getFlatHPPoolMod() + { + return $this->FlatHPPoolMod; + } + + /** + * @return double + */ + public function getFlatCritChanceMod() + { + return $this->FlatCritChanceMod; + } + + /** + * @return double + */ + public function getFlatEXPBonus() + { + return $this->FlatEXPBonus; + } + + /** + * @param double $PercentCritDamageMod + * + * @return $this + */ + public function setPercentCritDamageMod($PercentCritDamageMod) + { + $this->PercentCritDamageMod = $PercentCritDamageMod; + + return $this; + } + + /** + * @param double $PercentSpellBlockMod + * + * @return $this + */ + public function setPercentSpellBlockMod($PercentSpellBlockMod) + { + $this->PercentSpellBlockMod = $PercentSpellBlockMod; + + return $this; + } + + /** + * @param double $PercentHPRegenMod + * + * @return $this + */ + public function setPercentHPRegenMod($PercentHPRegenMod) + { + $this->PercentHPRegenMod = $PercentHPRegenMod; + + return $this; + } + + /** + * @param double $PercentMovementSpeedMod + * + * @return $this + */ + public function setPercentMovementSpeedMod($PercentMovementSpeedMod) + { + $this->PercentMovementSpeedMod = $PercentMovementSpeedMod; + + return $this; + } + + /** + * @param double $FlatSpellBlockMod + * + * @return $this + */ + public function setFlatSpellBlockMod($FlatSpellBlockMod) + { + $this->FlatSpellBlockMod = $FlatSpellBlockMod; + + return $this; + } + + /** + * @param double $FlatCritDamageMod + * + * @return $this + */ + public function setFlatCritDamageMod($FlatCritDamageMod) + { + $this->FlatCritDamageMod = $FlatCritDamageMod; + + return $this; + } + + /** + * @param double $FlatEnergyPoolMod + * + * @return $this + */ + public function setFlatEnergyPoolMod($FlatEnergyPoolMod) + { + $this->FlatEnergyPoolMod = $FlatEnergyPoolMod; + + return $this; + } + + /** + * @param double $PercentLifeStealMod + * + * @return $this + */ + public function setPercentLifeStealMod($PercentLifeStealMod) + { + $this->PercentLifeStealMod = $PercentLifeStealMod; + + return $this; + } + + /** + * @param double $FlatMPPoolMod + * + * @return $this + */ + public function setFlatMPPoolMod($FlatMPPoolMod) + { + $this->FlatMPPoolMod = $FlatMPPoolMod; + + return $this; + } + + /** + * @param double $FlatMovementSpeedMod + * + * @return $this + */ + public function setFlatMovementSpeedMod($FlatMovementSpeedMod) + { + $this->FlatMovementSpeedMod = $FlatMovementSpeedMod; + + return $this; + } + + /** + * @param double $PercentAttackSpeedMod + * + * @return $this + */ + public function setPercentAttackSpeedMod($PercentAttackSpeedMod) + { + $this->PercentAttackSpeedMod = $PercentAttackSpeedMod; + + return $this; + } + + /** + * @param double $FlatBlockMod + * + * @return $this + */ + public function setFlatBlockMod($FlatBlockMod) + { + $this->FlatBlockMod = $FlatBlockMod; + + return $this; + } + + /** + * @param double $PercentBlockMod + * + * @return $this + */ + public function setPercentBlockMod($PercentBlockMod) + { + $this->PercentBlockMod = $PercentBlockMod; + + return $this; + } + + /** + * @param double $FlatEnergyRegenMod + * + * @return $this + */ + public function setFlatEnergyRegenMod($FlatEnergyRegenMod) + { + $this->FlatEnergyRegenMod = $FlatEnergyRegenMod; + + return $this; + } + + /** + * @param double $PercentSpellVampMod + * + * @return $this + */ + public function setPercentSpellVampMod($PercentSpellVampMod) + { + $this->PercentSpellVampMod = $PercentSpellVampMod; + + return $this; + } + + /** + * @param double $FlatMPRegenMod + * + * @return $this + */ + public function setFlatMPRegenMod($FlatMPRegenMod) + { + $this->FlatMPRegenMod = $FlatMPRegenMod; + + return $this; + } + + /** + * @param double $PercentDodgeMod + * + * @return $this + */ + public function setPercentDodgeMod($PercentDodgeMod) + { + $this->PercentDodgeMod = $PercentDodgeMod; + + return $this; + } + + /** + * @param double $FlatAttackSpeedMod + * + * @return $this + */ + public function setFlatAttackSpeedMod($FlatAttackSpeedMod) + { + $this->FlatAttackSpeedMod = $FlatAttackSpeedMod; + + return $this; + } + + /** + * @param double $FlatArmorMod + * + * @return $this + */ + public function setFlatArmorMod($FlatArmorMod) + { + $this->FlatArmorMod = $FlatArmorMod; + + return $this; + } + + /** + * @param double $FlatHPRegenMod + * + * @return $this + */ + public function setFlatHPRegenMod($FlatHPRegenMod) + { + $this->FlatHPRegenMod = $FlatHPRegenMod; + + return $this; + } + + /** + * @param double $PercentMagicDamageMod + * + * @return $this + */ + public function setPercentMagicDamageMod($PercentMagicDamageMod) + { + $this->PercentMagicDamageMod = $PercentMagicDamageMod; + + return $this; + } + + /** + * @param double $PercentMPPoolMod + * + * @return $this + */ + public function setPercentMPPoolMod($PercentMPPoolMod) + { + $this->PercentMPPoolMod = $PercentMPPoolMod; + + return $this; + } + + /** + * @param double $FlatMagicDamageMod + * + * @return $this + */ + public function setFlatMagicDamageMod($FlatMagicDamageMod) + { + $this->FlatMagicDamageMod = $FlatMagicDamageMod; + + return $this; + } + + /** + * @param double $PercentMPRegenMod + * + * @return $this + */ + public function setPercentMPRegenMod($PercentMPRegenMod) + { + $this->PercentMPRegenMod = $PercentMPRegenMod; + + return $this; + } + + /** + * @param double $PercentPhysicalDamageMod + * + * @return $this + */ + public function setPercentPhysicalDamageMod($PercentPhysicalDamageMod) + { + $this->PercentPhysicalDamageMod = $PercentPhysicalDamageMod; + + return $this; + } + + /** + * @param double $FlatPhysicalDamageMod + * + * @return $this + */ + public function setFlatPhysicalDamageMod($FlatPhysicalDamageMod) + { + $this->FlatPhysicalDamageMod = $FlatPhysicalDamageMod; + + return $this; + } + + /** + * @param double $PercentHPPoolMod + * + * @return $this + */ + public function setPercentHPPoolMod($PercentHPPoolMod) + { + $this->PercentHPPoolMod = $PercentHPPoolMod; + + return $this; + } + + /** + * @param double $PercentArmorMod + * + * @return $this + */ + public function setPercentArmorMod($PercentArmorMod) + { + $this->PercentArmorMod = $PercentArmorMod; + + return $this; + } + + /** + * @param double $PercentCritChanceMod + * + * @return $this + */ + public function setPercentCritChanceMod($PercentCritChanceMod) + { + $this->PercentCritChanceMod = $PercentCritChanceMod; + + return $this; + } + + /** + * @param double $PercentEXPBonus + * + * @return $this + */ + public function setPercentEXPBonus($PercentEXPBonus) + { + $this->PercentEXPBonus = $PercentEXPBonus; + + return $this; + } + + /** + * @param double $FlatHPPoolMod + * + * @return $this + */ + public function setFlatHPPoolMod($FlatHPPoolMod) + { + $this->FlatHPPoolMod = $FlatHPPoolMod; + + return $this; + } + + /** + * @param double $FlatCritChanceMod + * + * @return $this + */ + public function setFlatCritChanceMod($FlatCritChanceMod) + { + $this->FlatCritChanceMod = $FlatCritChanceMod; + + return $this; + } + + /** + * @param double $FlatEXPBonus + * + * @return $this + */ + public function setFlatEXPBonus($FlatEXPBonus) + { + $this->FlatEXPBonus = $FlatEXPBonus; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/ItemDto.php b/src/LeagueWrap/Api/Dto/ItemDto.php new file mode 100644 index 0000000..61a4aae --- /dev/null +++ b/src/LeagueWrap/Api/Dto/ItemDto.php @@ -0,0 +1,543 @@ +gold; + } + + /** + * @return string + */ + public function getPlaintext() + { + return $this->plaintext; + } + + /** + * @return bool + */ + public function isHideFromAll() + { + return $this->hideFromAll; + } + + /** + * @return bool + */ + public function isInStore() + { + return $this->inStore; + } + + /** + * @return string[] + */ + public function getInto() + { + return $this->into; + } + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @return InventoryDataStatsDto + */ + public function getStats() + { + return $this->stats; + } + + /** + * @return string + */ + public function getColloq() + { + return $this->colloq; + } + + /** + * @return bool[] + */ + public function getMaps() + { + return $this->maps; + } + + /** + * @return int + */ + public function getSpecialRecipe() + { + return $this->specialRecipe; + } + + /** + * @return ImageDto + */ + public function getImage() + { + return $this->image; + } + + /** + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * @return string[] + */ + public function getTags() + { + return $this->tags; + } + + /** + * @return string[] + */ + public function getEffect() + { + return $this->effect; + } + + /** + * @return string + */ + public function getRequiredChampion() + { + return $this->requiredChampion; + } + + /** + * @return string[] + */ + public function getFrom() + { + return $this->from; + } + + /** + * @return string + */ + public function getGroup() + { + return $this->group; + } + + /** + * @return bool + */ + public function isConsumeOnFull() + { + return $this->consumeOnFull; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @return bool + */ + public function isConsumed() + { + return $this->consumed; + } + + /** + * @return string + */ + public function getSanitizedDescription() + { + return $this->sanitizedDescription; + } + + /** + * @return int + */ + public function getDepth() + { + return $this->depth; + } + + /** + * @return int + */ + public function getStacks() + { + return $this->stacks; + } + + /** + * @param GoldDto $gold + * + * @return $this + */ + public function setGold($gold) + { + $this->gold = new GoldDto($gold); + + return $this; + } + + /** + * @param string $plaintext + * + * @return $this + */ + public function setPlaintext($plaintext) + { + $this->plaintext = $plaintext; + + return $this; + } + + /** + * @param bool $hideFromAll + * + * @return $this + */ + public function setHideFromAll($hideFromAll) + { + $this->hideFromAll = $hideFromAll; + + return $this; + } + + /** + * @param bool $inStore + * + * @return $this + */ + public function setInStore($inStore) + { + $this->inStore = $inStore; + + return $this; + } + + /** + * @param string[] $into + * + * @return $this + */ + public function setInto($into) + { + $this->into = $into; + + return $this; + } + + /** + * @param int $id + * + * @return $this + */ + public function setId($id) + { + $this->id = $id; + + return $this; + } + + /** + * @param InventoryDataStatsDto $stats + * + * @return $this + */ + public function setStats($stats) + { + $this->stats = new InventoryDataStatsDto($stats); + + return $this; + } + + /** + * @param string $colloq + * + * @return $this + */ + public function setColloq($colloq) + { + $this->colloq = $colloq; + + return $this; + } + + /** + * @param bool[] $maps Map[string, boolean] + * + * @return $this + */ + public function setMaps($maps) + { + $this->maps = $maps; + + return $this; + } + + /** + * @param int $specialRecipe + * + * @return $this + */ + public function setSpecialRecipe($specialRecipe) + { + $this->specialRecipe = $specialRecipe; + + return $this; + } + + /** + * @param ImageDto $image + * + * @return $this + */ + public function setImage($image) + { + $this->image = new ImageDto($image); + + return $this; + } + + /** + * @param string $description + * + * @return $this + */ + public function setDescription($description) + { + $this->description = $description; + + return $this; + } + + /** + * @param string[] $tags + * + * @return $this + */ + public function setTags($tags) + { + $this->tags = $tags; + + return $this; + } + + /** + * @param string[] $effect Map[string, string] + * + * @return $this + */ + public function setEffect($effect) + { + $this->effect = $effect; + + return $this; + } + + /** + * @param string $requiredChampion + * + * @return $this + */ + public function setRequiredChampion($requiredChampion) + { + $this->requiredChampion = $requiredChampion; + + return $this; + } + + /** + * @param string[] $from + * + * @return $this + */ + public function setFrom($from) + { + $this->from = $from; + + return $this; + } + + /** + * @param string $group + * + * @return $this + */ + public function setGroup($group) + { + $this->group = $group; + + return $this; + } + + /** + * @param bool $consumeOnFull + * + * @return $this + */ + public function setConsumeOnFull($consumeOnFull) + { + $this->consumeOnFull = $consumeOnFull; + + return $this; + } + + /** + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * @param bool $consumed + * + * @return $this + */ + public function setConsumed($consumed) + { + $this->consumed = $consumed; + + return $this; + } + + /** + * @param string $sanitizedDescription + * + * @return $this + */ + public function setSanitizedDescription($sanitizedDescription) + { + $this->sanitizedDescription = $sanitizedDescription; + + return $this; + } + + /** + * @param int $depth + * + * @return $this + */ + public function setDepth($depth) + { + $this->depth = $depth; + + return $this; + } + + /** + * @param int $stacks + * + * @return $this + */ + public function setStacks($stacks) + { + $this->stacks = $stacks; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/ItemListDto.php b/src/LeagueWrap/Api/Dto/ItemListDto.php new file mode 100644 index 0000000..9f5f5e1 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/ItemListDto.php @@ -0,0 +1,135 @@ +data; + } + + /** + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * @return ItemTreeDto[] + */ + public function getTree() + { + return $this->tree; + } + + /** + * @return GroupDto[] + */ + public function getGroups() + { + return $this->groups; + } + + /** + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * @param ItemDto[] $data Map[string, ItemDto] + * + * @return $this + */ + public function setData($data) + { + foreach ($data as $key => $dtoData) { + $this->data[$key] = new ItemDto($dtoData); + } + + return $this; + } + + /** + * @param string $version + * + * @return $this + */ + public function setVersion($version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ItemTreeDto[] $tree + * + * @return $this + */ + public function setTree($tree) + { + foreach ($tree as $key => $dtoData) { + $this->tree[$key] = new ItemTreeDto($dtoData); + } + + return $this; + } + + /** + * @param GroupDto[] $groups + * + * @return $this + */ + public function setGroups($groups) + { + foreach ($groups as $key => $dtoData) { + $this->groups[$key] = new GroupDto($dtoData); + } + + return $this; + } + + /** + * @param string $type + * + * @return $this + */ + public function setType($type) + { + $this->type = $type; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/ItemTreeDto.php b/src/LeagueWrap/Api/Dto/ItemTreeDto.php new file mode 100644 index 0000000..1d5a2a9 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/ItemTreeDto.php @@ -0,0 +1,60 @@ +header; + } + + /** + * @return string[] + */ + public function getTags() + { + return $this->tags; + } + + /** + * @param string $header + * + * @return $this + */ + public function setHeader($header) + { + $this->header = $header; + + return $this; + } + + /** + * @param string[] $tags + * + * @return $this + */ + public function setTags($tags) + { + $this->tags = $tags; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/LanguageStringsDto.php b/src/LeagueWrap/Api/Dto/LanguageStringsDto.php new file mode 100644 index 0000000..7e6cb54 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/LanguageStringsDto.php @@ -0,0 +1,83 @@ +data; + } + + /** + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * @param string[] $data Map[string, string] + * + * @return $this + */ + public function setData($data) + { + $this->data = $data; + + return $this; + } + + /** + * @param string $version + * + * @return $this + */ + public function setVersion($version) + { + $this->version = $version; + + return $this; + } + + /** + * @param string $type + * + * @return $this + */ + public function setType($type) + { + $this->type = $type; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/LeagueItemDto.php b/src/LeagueWrap/Api/Dto/LeagueItemDto.php new file mode 100644 index 0000000..3e9b5c0 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/LeagueItemDto.php @@ -0,0 +1,267 @@ +rank; + } + + /** + * @return bool + */ + public function isHotStreak() + { + return $this->hotStreak; + } + + /** + * @return MiniSeriesDto + */ + public function getMiniSeries() + { + return $this->miniSeries; + } + + /** + * @return int + */ + public function getWins() + { + return $this->wins; + } + + /** + * @return bool + */ + public function isVeteran() + { + return $this->veteran; + } + + /** + * @return int + */ + public function getLosses() + { + return $this->losses; + } + + /** + * @return string + */ + public function getPlayerOrTeamId() + { + return $this->playerOrTeamId; + } + + /** + * @return string + */ + public function getPlayerOrTeamName() + { + return $this->playerOrTeamName; + } + + /** + * @return bool + */ + public function isInactive() + { + return $this->inactive; + } + + /** + * @return bool + */ + public function isFreshBlood() + { + return $this->freshBlood; + } + + /** + * @return int + */ + public function getLeaguePoints() + { + return $this->leaguePoints; + } + + /** + * @param string $rank + * + * @return $this + */ + public function setRank($rank) + { + $this->rank = $rank; + + return $this; + } + + /** + * @param bool $hotStreak + * + * @return $this + */ + public function setHotStreak($hotStreak) + { + $this->hotStreak = $hotStreak; + + return $this; + } + + /** + * @param MiniSeriesDto $miniSeries + * + * @return $this + */ + public function setMiniSeries($miniSeries) + { + $this->miniSeries = new MiniSeriesDto($miniSeries); + + return $this; + } + + /** + * @param int $wins + * + * @return $this + */ + public function setWins($wins) + { + $this->wins = $wins; + + return $this; + } + + /** + * @param bool $veteran + * + * @return $this + */ + public function setVeteran($veteran) + { + $this->veteran = $veteran; + + return $this; + } + + /** + * @param int $losses + * + * @return $this + */ + public function setLosses($losses) + { + $this->losses = $losses; + + return $this; + } + + /** + * @param string $playerOrTeamId + * + * @return $this + */ + public function setPlayerOrTeamId($playerOrTeamId) + { + $this->playerOrTeamId = $playerOrTeamId; + + return $this; + } + + /** + * @param string $playerOrTeamName + * + * @return $this + */ + public function setPlayerOrTeamName($playerOrTeamName) + { + $this->playerOrTeamName = $playerOrTeamName; + + return $this; + } + + /** + * @param bool $inactive + * + * @return $this + */ + public function setInactive($inactive) + { + $this->inactive = $inactive; + + return $this; + } + + /** + * @param bool $freshBlood + * + * @return $this + */ + public function setFreshBlood($freshBlood) + { + $this->freshBlood = $freshBlood; + + return $this; + } + + /** + * @param int $leaguePoints + * + * @return $this + */ + public function setLeaguePoints($leaguePoints) + { + $this->leaguePoints = $leaguePoints; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/LeagueListDto.php b/src/LeagueWrap/Api/Dto/LeagueListDto.php new file mode 100644 index 0000000..f1a45a3 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/LeagueListDto.php @@ -0,0 +1,108 @@ +tier; + } + + /** + * @return string + */ + public function getQueue() + { + return $this->queue; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @return LeagueItemDto[] + */ + public function getEntries() + { + return $this->entries; + } + + /** + * @param string $tier + * + * @return $this + */ + public function setTier($tier) + { + $this->tier = $tier; + + return $this; + } + + /** + * @param string $queue + * + * @return $this + */ + public function setQueue($queue) + { + $this->queue = $queue; + + return $this; + } + + /** + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * @param LeagueItemDto[] $entries + * + * @return $this + */ + public function setEntries($entries) + { + foreach ($entries as $key => $dtoData) { + $this->entries[$key] = new LeagueItemDto($dtoData); + } + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/LeaguePositionDto.php b/src/LeagueWrap/Api/Dto/LeaguePositionDto.php new file mode 100644 index 0000000..08e1099 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/LeaguePositionDto.php @@ -0,0 +1,336 @@ +rank; + } + + /** + * @return Enum\QueueType::CUSTOM|Enum\QueueType::NORMAL_3x3|Enum\QueueType::NORMAL_5x5_BLIND|Enum\QueueType::NORMAL_5x5_DRAFT|Enum\QueueType::RANKED_SOLO_5x5|Enum\QueueType::RANKED_PREMADE_5x5|Enum\QueueType::RANKED_PREMADE_3x3|Enum\QueueType::RANKED_FLEX_TT|Enum\QueueType::RANKED_TEAM_3x3|Enum\QueueType::RANKED_TEAM_5x5|Enum\QueueType::ODIN_5x5_BLIND|Enum\QueueType::ODIN_5x5_DRAFT|Enum\QueueType::BOT_5x5|Enum\QueueType::BOT_ODIN_5x5|Enum\QueueType::BOT_5x5_INTRO|Enum\QueueType::BOT_5x5_BEGINNER|Enum\QueueType::BOT_5x5_INTERMEDIATE|Enum\QueueType::BOT_TT_3x3|Enum\QueueType::GROUP_FINDER_5x5|Enum\QueueType::ARAM_5x5|Enum\QueueType::ONEFORALL_5x5|Enum\QueueType::FIRSTBLOOD_1x1|Enum\QueueType::FIRSTBLOOD_2x2|Enum\QueueType::SR_6x6|Enum\QueueType::URF_5x5|Enum\QueueType::ONEFORALL_MIRRORMODE_5x5|Enum\QueueType::BOT_URF_5x5|Enum\QueueType::NIGHTMARE_BOT_5x5_RANK1|Enum\QueueType::NIGHTMARE_BOT_5x5_RANK2|Enum\QueueType::NIGHTMARE_BOT_5x5_RANK5|Enum\QueueType::ASCENSION_5x5|Enum\QueueType::HEXAKILL|Enum\QueueType::BILGEWATER_ARAM_5x5|Enum\QueueType::KING_PORO_5x5|Enum\QueueType::COUNTER_PICK|Enum\QueueType::BILGEWATER_5x5|Enum\QueueType::SIEGE|Enum\QueueType::DEFINITELY_NOT_DOMINION_5x5|Enum\QueueType::ARURF_5X5|Enum\QueueType::ARSR_5x5|Enum\QueueType::TEAM_BUILDER_DRAFT_UNRANKED_5x5|Enum\QueueType::TEAM_BUILDER_DRAFT_RANKED_5x5|Enum\QueueType::TEAM_BUILDER_RANKED_SOLO|Enum\QueueType::TB_BLIND_SUMMONERS_RIFT_5x5|Enum\QueueType::RANKED_FLEX_SR|Enum\QueueType::ASSASSINATE_5x5|Enum\QueueType::DARKSTAR_3x3 + */ + public function getQueueType() + { + return $this->queueType; + } + + /** + * @return bool + */ + public function isHotStreak() + { + return $this->hotStreak; + } + + /** + * @return MiniSeriesDto + */ + public function getMiniSeries() + { + return $this->miniSeries; + } + + /** + * @return int + */ + public function getWins() + { + return $this->wins; + } + + /** + * @return bool + */ + public function isVeteran() + { + return $this->veteran; + } + + /** + * @return int + */ + public function getLosses() + { + return $this->losses; + } + + /** + * @return string + */ + public function getPlayerOrTeamId() + { + return $this->playerOrTeamId; + } + + /** + * @return string + */ + public function getLeagueName() + { + return $this->leagueName; + } + + /** + * @return string + */ + public function getPlayerOrTeamName() + { + return $this->playerOrTeamName; + } + + /** + * @return bool + */ + public function isInactive() + { + return $this->inactive; + } + + /** + * @return bool + */ + public function isFreshBlood() + { + return $this->freshBlood; + } + + /** + * @return string + */ + public function getTier() + { + return $this->tier; + } + + /** + * @return int + */ + public function getLeaguePoints() + { + return $this->leaguePoints; + } + + /** + * @param string $rank + * + * @return $this + */ + public function setRank($rank) + { + $this->rank = $rank; + + return $this; + } + + /** + * @param Enum\QueueType::CUSTOM|Enum\QueueType::NORMAL_3x3|Enum\QueueType::NORMAL_5x5_BLIND|Enum\QueueType::NORMAL_5x5_DRAFT|Enum\QueueType::RANKED_SOLO_5x5|Enum\QueueType::RANKED_PREMADE_5x5|Enum\QueueType::RANKED_PREMADE_3x3|Enum\QueueType::RANKED_FLEX_TT|Enum\QueueType::RANKED_TEAM_3x3|Enum\QueueType::RANKED_TEAM_5x5|Enum\QueueType::ODIN_5x5_BLIND|Enum\QueueType::ODIN_5x5_DRAFT|Enum\QueueType::BOT_5x5|Enum\QueueType::BOT_ODIN_5x5|Enum\QueueType::BOT_5x5_INTRO|Enum\QueueType::BOT_5x5_BEGINNER|Enum\QueueType::BOT_5x5_INTERMEDIATE|Enum\QueueType::BOT_TT_3x3|Enum\QueueType::GROUP_FINDER_5x5|Enum\QueueType::ARAM_5x5|Enum\QueueType::ONEFORALL_5x5|Enum\QueueType::FIRSTBLOOD_1x1|Enum\QueueType::FIRSTBLOOD_2x2|Enum\QueueType::SR_6x6|Enum\QueueType::URF_5x5|Enum\QueueType::ONEFORALL_MIRRORMODE_5x5|Enum\QueueType::BOT_URF_5x5|Enum\QueueType::NIGHTMARE_BOT_5x5_RANK1|Enum\QueueType::NIGHTMARE_BOT_5x5_RANK2|Enum\QueueType::NIGHTMARE_BOT_5x5_RANK5|Enum\QueueType::ASCENSION_5x5|Enum\QueueType::HEXAKILL|Enum\QueueType::BILGEWATER_ARAM_5x5|Enum\QueueType::KING_PORO_5x5|Enum\QueueType::COUNTER_PICK|Enum\QueueType::BILGEWATER_5x5|Enum\QueueType::SIEGE|Enum\QueueType::DEFINITELY_NOT_DOMINION_5x5|Enum\QueueType::ARURF_5X5|Enum\QueueType::ARSR_5x5|Enum\QueueType::TEAM_BUILDER_DRAFT_UNRANKED_5x5|Enum\QueueType::TEAM_BUILDER_DRAFT_RANKED_5x5|Enum\QueueType::TEAM_BUILDER_RANKED_SOLO|Enum\QueueType::TB_BLIND_SUMMONERS_RIFT_5x5|Enum\QueueType::RANKED_FLEX_SR|Enum\QueueType::ASSASSINATE_5x5|Enum\QueueType::DARKSTAR_3x3 $queueType + * + * @return $this + */ + public function setQueueType($queueType) + { + $this->queueType = $queueType; + + return $this; + } + + /** + * @param bool $hotStreak + * + * @return $this + */ + public function setHotStreak($hotStreak) + { + $this->hotStreak = $hotStreak; + + return $this; + } + + /** + * @param MiniSeriesDto $miniSeries + * + * @return $this + */ + public function setMiniSeries($miniSeries) + { + $this->miniSeries = new MiniSeriesDto($miniSeries); + + return $this; + } + + /** + * @param int $wins + * + * @return $this + */ + public function setWins($wins) + { + $this->wins = $wins; + + return $this; + } + + /** + * @param bool $veteran + * + * @return $this + */ + public function setVeteran($veteran) + { + $this->veteran = $veteran; + + return $this; + } + + /** + * @param int $losses + * + * @return $this + */ + public function setLosses($losses) + { + $this->losses = $losses; + + return $this; + } + + /** + * @param string $playerOrTeamId + * + * @return $this + */ + public function setPlayerOrTeamId($playerOrTeamId) + { + $this->playerOrTeamId = $playerOrTeamId; + + return $this; + } + + /** + * @param string $leagueName + * + * @return $this + */ + public function setLeagueName($leagueName) + { + $this->leagueName = $leagueName; + + return $this; + } + + /** + * @param string $playerOrTeamName + * + * @return $this + */ + public function setPlayerOrTeamName($playerOrTeamName) + { + $this->playerOrTeamName = $playerOrTeamName; + + return $this; + } + + /** + * @param bool $inactive + * + * @return $this + */ + public function setInactive($inactive) + { + $this->inactive = $inactive; + + return $this; + } + + /** + * @param bool $freshBlood + * + * @return $this + */ + public function setFreshBlood($freshBlood) + { + $this->freshBlood = $freshBlood; + + return $this; + } + + /** + * @param string $tier + * + * @return $this + */ + public function setTier($tier) + { + $this->tier = $tier; + + return $this; + } + + /** + * @param int $leaguePoints + * + * @return $this + */ + public function setLeaguePoints($leaguePoints) + { + $this->leaguePoints = $leaguePoints; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/LevelTipDto.php b/src/LeagueWrap/Api/Dto/LevelTipDto.php new file mode 100644 index 0000000..9e447a3 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/LevelTipDto.php @@ -0,0 +1,60 @@ +effect; + } + + /** + * @return string[] + */ + public function getLabel() + { + return $this->label; + } + + /** + * @param string[] $effect + * + * @return $this + */ + public function setEffect($effect) + { + $this->effect = $effect; + + return $this; + } + + /** + * @param string[] $label + * + * @return $this + */ + public function setLabel($label) + { + $this->label = $label; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/LobbyEventDto.php b/src/LeagueWrap/Api/Dto/LobbyEventDto.php new file mode 100644 index 0000000..f922f3a --- /dev/null +++ b/src/LeagueWrap/Api/Dto/LobbyEventDto.php @@ -0,0 +1,83 @@ +eventType; + } + + /** + * @return string + */ + public function getSummonerId() + { + return $this->summonerId; + } + + /** + * @return string + */ + public function getTimestamp() + { + return $this->timestamp; + } + + /** + * @param string $eventType + * + * @return $this + */ + public function setEventType($eventType) + { + $this->eventType = $eventType; + + return $this; + } + + /** + * @param string $summonerId + * + * @return $this + */ + public function setSummonerId($summonerId) + { + $this->summonerId = $summonerId; + + return $this; + } + + /** + * @param string $timestamp + * + * @return $this + */ + public function setTimestamp($timestamp) + { + $this->timestamp = $timestamp; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/LobbyEventDtoWrapper.php b/src/LeagueWrap/Api/Dto/LobbyEventDtoWrapper.php new file mode 100644 index 0000000..172c11b --- /dev/null +++ b/src/LeagueWrap/Api/Dto/LobbyEventDtoWrapper.php @@ -0,0 +1,39 @@ +eventList; + } + + /** + * @param LobbyEventDto[] $eventList + * + * @return $this + */ + public function setEventList($eventList) + { + foreach ($eventList as $key => $dtoData) { + $this->eventList[$key] = new LobbyEventDto($dtoData); + } + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/MapDataDto.php b/src/LeagueWrap/Api/Dto/MapDataDto.php new file mode 100644 index 0000000..fe03f7c --- /dev/null +++ b/src/LeagueWrap/Api/Dto/MapDataDto.php @@ -0,0 +1,85 @@ +data; + } + + /** + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * @param DetailsDto[] $data Map[string, MapDetailsDto] + * + * @return $this + */ + public function setData($data) + { + foreach ($data as $key => $dtoData) { + $this->data[$key] = new DetailsDto($dtoData); + } + + return $this; + } + + /** + * @param string $version + * + * @return $this + */ + public function setVersion($version) + { + $this->version = $version; + + return $this; + } + + /** + * @param string $type + * + * @return $this + */ + public function setType($type) + { + $this->type = $type; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/MapDetailsDto.php b/src/LeagueWrap/Api/Dto/MapDetailsDto.php new file mode 100644 index 0000000..f5fcfbf --- /dev/null +++ b/src/LeagueWrap/Api/Dto/MapDetailsDto.php @@ -0,0 +1,106 @@ +mapName; + } + + /** + * @return ImageDto + */ + public function getImage() + { + return $this->image; + } + + /** + * @return double + */ + public function getMapId() + { + return $this->mapId; + } + + /** + * @return double[] + */ + public function getUnpurchasableItemList() + { + return $this->unpurchasableItemList; + } + + /** + * @param string $mapName + * + * @return $this + */ + public function setMapName($mapName) + { + $this->mapName = $mapName; + + return $this; + } + + /** + * @param ImageDto $image + * + * @return $this + */ + public function setImage($image) + { + $this->image = new ImageDto($image); + + return $this; + } + + /** + * @param double $mapId + * + * @return $this + */ + public function setMapId($mapId) + { + $this->mapId = $mapId; + + return $this; + } + + /** + * @param double[] $unpurchasableItemList + * + * @return $this + */ + public function setUnpurchasableItemList($unpurchasableItemList) + { + $this->unpurchasableItemList = $unpurchasableItemList; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/Mastery.php b/src/LeagueWrap/Api/Dto/Mastery.php new file mode 100644 index 0000000..1444fca --- /dev/null +++ b/src/LeagueWrap/Api/Dto/Mastery.php @@ -0,0 +1,60 @@ +masteryId; + } + + /** + * @return int + */ + public function getRank() + { + return $this->rank; + } + + /** + * @param double $masteryId + * + * @return $this + */ + public function setMasteryId($masteryId) + { + $this->masteryId = $masteryId; + + return $this; + } + + /** + * @param int $rank + * + * @return $this + */ + public function setRank($rank) + { + $this->rank = $rank; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/MasteryDto.php b/src/LeagueWrap/Api/Dto/MasteryDto.php new file mode 100644 index 0000000..3ebf24a --- /dev/null +++ b/src/LeagueWrap/Api/Dto/MasteryDto.php @@ -0,0 +1,60 @@ +masteryId; + } + + /** + * @return int + */ + public function getRank() + { + return $this->rank; + } + + /** + * @param int $masteryId + * + * @return $this + */ + public function setMasteryId($masteryId) + { + $this->masteryId = $masteryId; + + return $this; + } + + /** + * @param int $rank + * + * @return $this + */ + public function setRank($rank) + { + $this->rank = $rank; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/MasteryListDto.php b/src/LeagueWrap/Api/Dto/MasteryListDto.php new file mode 100644 index 0000000..f8a0337 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/MasteryListDto.php @@ -0,0 +1,108 @@ +data; + } + + /** + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * @return MasteryTreeDto + */ + public function getTree() + { + return $this->tree; + } + + /** + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * @param MasteryDto[] $data Map[string, MasteryDto] + * + * @return $this + */ + public function setData($data) + { + foreach ($data as $key => $dtoData) { + $this->data[$key] = new MasteryDto($dtoData); + } + + return $this; + } + + /** + * @param string $version + * + * @return $this + */ + public function setVersion($version) + { + $this->version = $version; + + return $this; + } + + /** + * @param MasteryTreeDto $tree + * + * @return $this + */ + public function setTree($tree) + { + $this->tree = new MasteryTreeDto($tree); + + return $this; + } + + /** + * @param string $type + * + * @return $this + */ + public function setType($type) + { + $this->type = $type; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/MasteryPageDto.php b/src/LeagueWrap/Api/Dto/MasteryPageDto.php new file mode 100644 index 0000000..da8d58b --- /dev/null +++ b/src/LeagueWrap/Api/Dto/MasteryPageDto.php @@ -0,0 +1,108 @@ +current; + } + + /** + * @return MasteryDto[] + */ + public function getMasteries() + { + return $this->masteries; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @return double + */ + public function getId() + { + return $this->id; + } + + /** + * @param bool $current + * + * @return $this + */ + public function setCurrent($current) + { + $this->current = $current; + + return $this; + } + + /** + * @param MasteryDto[] $masteries + * + * @return $this + */ + public function setMasteries($masteries) + { + foreach ($masteries as $key => $dtoData) { + $this->masteries[$key] = new MasteryDto($dtoData); + } + + return $this; + } + + /** + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * @param double $id + * + * @return $this + */ + public function setId($id) + { + $this->id = $id; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/MasteryPagesDto.php b/src/LeagueWrap/Api/Dto/MasteryPagesDto.php new file mode 100644 index 0000000..b2777d4 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/MasteryPagesDto.php @@ -0,0 +1,62 @@ +pages; + } + + /** + * @return double + */ + public function getSummonerId() + { + return $this->summonerId; + } + + /** + * @param MasteryPageDto[] $pages + * + * @return $this + */ + public function setPages($pages) + { + foreach ($pages as $key => $dtoData) { + $this->pages[$key] = new MasteryPageDto($dtoData); + } + + return $this; + } + + /** + * @param double $summonerId + * + * @return $this + */ + public function setSummonerId($summonerId) + { + $this->summonerId = $summonerId; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/MasteryTreeDto.php b/src/LeagueWrap/Api/Dto/MasteryTreeDto.php new file mode 100644 index 0000000..1f74ae4 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/MasteryTreeDto.php @@ -0,0 +1,89 @@ +Resolve; + } + + /** + * @return MasteryTreeDto[] + */ + public function getFerocity() + { + return $this->Ferocity; + } + + /** + * @return MasteryTreeDto[] + */ + public function getCunning() + { + return $this->Cunning; + } + + /** + * @param MasteryTreeDto[] $Resolve + * + * @return $this + */ + public function setResolve($Resolve) + { + foreach ($Resolve as $key => $dtoData) { + $this->Resolve[$key] = new MasteryTreeDto($dtoData); + } + + return $this; + } + + /** + * @param MasteryTreeDto[] $Ferocity + * + * @return $this + */ + public function setFerocity($Ferocity) + { + foreach ($Ferocity as $key => $dtoData) { + $this->Ferocity[$key] = new MasteryTreeDto($dtoData); + } + + return $this; + } + + /** + * @param MasteryTreeDto[] $Cunning + * + * @return $this + */ + public function setCunning($Cunning) + { + foreach ($Cunning as $key => $dtoData) { + $this->Cunning[$key] = new MasteryTreeDto($dtoData); + } + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/MasteryTreeItemDto.php b/src/LeagueWrap/Api/Dto/MasteryTreeItemDto.php new file mode 100644 index 0000000..1307617 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/MasteryTreeItemDto.php @@ -0,0 +1,60 @@ +masteryId; + } + + /** + * @return string + */ + public function getPrereq() + { + return $this->prereq; + } + + /** + * @param int $masteryId + * + * @return $this + */ + public function setMasteryId($masteryId) + { + $this->masteryId = $masteryId; + + return $this; + } + + /** + * @param string $prereq + * + * @return $this + */ + public function setPrereq($prereq) + { + $this->prereq = $prereq; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/MasteryTreeListDto.php b/src/LeagueWrap/Api/Dto/MasteryTreeListDto.php new file mode 100644 index 0000000..7f2f7c5 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/MasteryTreeListDto.php @@ -0,0 +1,39 @@ +masteryTreeItems; + } + + /** + * @param MasteryTreeItemDto[] $masteryTreeItems + * + * @return $this + */ + public function setMasteryTreeItems($masteryTreeItems) + { + foreach ($masteryTreeItems as $key => $dtoData) { + $this->masteryTreeItems[$key] = new MasteryTreeItemDto($dtoData); + } + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/MatchDto.php b/src/LeagueWrap/Api/Dto/MatchDto.php new file mode 100644 index 0000000..ca04776 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/MatchDto.php @@ -0,0 +1,319 @@ +seasonId; + } + + /** + * @return int + */ + public function getQueueId() + { + return $this->queueId; + } + + /** + * @return double + */ + public function getGameId() + { + return $this->gameId; + } + + /** + * @return ParticipantIdentityDto[] + */ + public function getParticipantIdentities() + { + return $this->participantIdentities; + } + + /** + * @return string + */ + public function getGameVersion() + { + return $this->gameVersion; + } + + /** + * @return string + */ + public function getPlatformId() + { + return $this->platformId; + } + + /** + * @return Enum\GameMode::CLASSIC|Enum\GameMode::ODIN|Enum\GameMode::ARAM|Enum\GameMode::TUTORIAL|Enum\GameMode::ONEFORALL|Enum\GameMode::ASCENSION|Enum\GameMode::FIRSTBLOOD|Enum\GameMode::KINGPORO|Enum\GameMode::SIEGE|Enum\GameMode::ASSASSINATE|Enum\GameMode::ARSR|Enum\GameMode::DARKSTAR + */ + public function getGameMode() + { + return $this->gameMode; + } + + /** + * @return int + */ + public function getMapId() + { + return $this->mapId; + } + + /** + * @return Enum\GameType::CUSTOM_GAME|Enum\GameType::TUTORIAL_GAME|Enum\GameType::MATCHED_GAME + */ + public function getGameType() + { + return $this->gameType; + } + + /** + * @return TeamStatsDto[] + */ + public function getTeams() + { + return $this->teams; + } + + /** + * @return ParticipantDto[] + */ + public function getParticipants() + { + return $this->participants; + } + + /** + * @return double + */ + public function getGameDuration() + { + return $this->gameDuration; + } + + /** + * @return double + */ + public function getGameCreation() + { + return $this->gameCreation; + } + + /** + * @param int $seasonId + * + * @return $this + */ + public function setSeasonId($seasonId) + { + $this->seasonId = $seasonId; + + return $this; + } + + /** + * @param int $queueId + * + * @return $this + */ + public function setQueueId($queueId) + { + $this->queueId = $queueId; + + return $this; + } + + /** + * @param double $gameId + * + * @return $this + */ + public function setGameId($gameId) + { + $this->gameId = $gameId; + + return $this; + } + + /** + * @param ParticipantIdentityDto[] $participantIdentities + * + * @return $this + */ + public function setParticipantIdentities($participantIdentities) + { + foreach ($participantIdentities as $key => $dtoData) { + $this->participantIdentities[$key] = new ParticipantIdentityDto($dtoData); + } + + return $this; + } + + /** + * @param string $gameVersion + * + * @return $this + */ + public function setGameVersion($gameVersion) + { + $this->gameVersion = $gameVersion; + + return $this; + } + + /** + * @param string $platformId + * + * @return $this + */ + public function setPlatformId($platformId) + { + $this->platformId = $platformId; + + return $this; + } + + /** + * @param Enum\GameMode::CLASSIC|Enum\GameMode::ODIN|Enum\GameMode::ARAM|Enum\GameMode::TUTORIAL|Enum\GameMode::ONEFORALL|Enum\GameMode::ASCENSION|Enum\GameMode::FIRSTBLOOD|Enum\GameMode::KINGPORO|Enum\GameMode::SIEGE|Enum\GameMode::ASSASSINATE|Enum\GameMode::ARSR|Enum\GameMode::DARKSTAR $gameMode + * + * @return $this + */ + public function setGameMode($gameMode) + { + $this->gameMode = $gameMode; + + return $this; + } + + /** + * @param int $mapId + * + * @return $this + */ + public function setMapId($mapId) + { + $this->mapId = $mapId; + + return $this; + } + + /** + * @param Enum\GameType::CUSTOM_GAME|Enum\GameType::TUTORIAL_GAME|Enum\GameType::MATCHED_GAME $gameType + * + * @return $this + */ + public function setGameType($gameType) + { + $this->gameType = $gameType; + + return $this; + } + + /** + * @param TeamStatsDto[] $teams + * + * @return $this + */ + public function setTeams($teams) + { + foreach ($teams as $key => $dtoData) { + $this->teams[$key] = new TeamStatsDto($dtoData); + } + + return $this; + } + + /** + * @param ParticipantDto[] $participants + * + * @return $this + */ + public function setParticipants($participants) + { + foreach ($participants as $key => $dtoData) { + $this->participants[$key] = new ParticipantDto($dtoData); + } + + return $this; + } + + /** + * @param double $gameDuration + * + * @return $this + */ + public function setGameDuration($gameDuration) + { + $this->gameDuration = $gameDuration; + + return $this; + } + + /** + * @param double $gameCreation + * + * @return $this + */ + public function setGameCreation($gameCreation) + { + $this->gameCreation = $gameCreation; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/MatchEventDto.php b/src/LeagueWrap/Api/Dto/MatchEventDto.php new file mode 100644 index 0000000..2650cd5 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/MatchEventDto.php @@ -0,0 +1,543 @@ +eventType; + } + + /** + * @return string + */ + public function getTowerType() + { + return $this->towerType; + } + + /** + * @return int + */ + public function getTeamId() + { + return $this->teamId; + } + + /** + * @return string + */ + public function getAscendedType() + { + return $this->ascendedType; + } + + /** + * @return int + */ + public function getKillerId() + { + return $this->killerId; + } + + /** + * @return string + */ + public function getLevelUpType() + { + return $this->levelUpType; + } + + /** + * @return string + */ + public function getPointCaptured() + { + return $this->pointCaptured; + } + + /** + * @return int[] + */ + public function getAssistingParticipantIds() + { + return $this->assistingParticipantIds; + } + + /** + * @return string + */ + public function getWardType() + { + return $this->wardType; + } + + /** + * @return string + */ + public function getMonsterType() + { + return $this->monsterType; + } + + /** + * @return Type + */ + public function getType() + { + return $this->type; + } + + /** + * @return int + */ + public function getSkillSlot() + { + return $this->skillSlot; + } + + /** + * @return int + */ + public function getVictimId() + { + return $this->victimId; + } + + /** + * @return double + */ + public function getTimestamp() + { + return $this->timestamp; + } + + /** + * @return int + */ + public function getAfterId() + { + return $this->afterId; + } + + /** + * @return string + */ + public function getMonsterSubType() + { + return $this->monsterSubType; + } + + /** + * @return string + */ + public function getLaneType() + { + return $this->laneType; + } + + /** + * @return int + */ + public function getItemId() + { + return $this->itemId; + } + + /** + * @return int + */ + public function getParticipantId() + { + return $this->participantId; + } + + /** + * @return string + */ + public function getBuildingType() + { + return $this->buildingType; + } + + /** + * @return int + */ + public function getCreatorId() + { + return $this->creatorId; + } + + /** + * @return MatchPositionDto + */ + public function getPosition() + { + return $this->position; + } + + /** + * @return int + */ + public function getBeforeId() + { + return $this->beforeId; + } + + /** + * @param string $eventType + * + * @return $this + */ + public function setEventType($eventType) + { + $this->eventType = $eventType; + + return $this; + } + + /** + * @param string $towerType + * + * @return $this + */ + public function setTowerType($towerType) + { + $this->towerType = $towerType; + + return $this; + } + + /** + * @param int $teamId + * + * @return $this + */ + public function setTeamId($teamId) + { + $this->teamId = $teamId; + + return $this; + } + + /** + * @param string $ascendedType + * + * @return $this + */ + public function setAscendedType($ascendedType) + { + $this->ascendedType = $ascendedType; + + return $this; + } + + /** + * @param int $killerId + * + * @return $this + */ + public function setKillerId($killerId) + { + $this->killerId = $killerId; + + return $this; + } + + /** + * @param string $levelUpType + * + * @return $this + */ + public function setLevelUpType($levelUpType) + { + $this->levelUpType = $levelUpType; + + return $this; + } + + /** + * @param string $pointCaptured + * + * @return $this + */ + public function setPointCaptured($pointCaptured) + { + $this->pointCaptured = $pointCaptured; + + return $this; + } + + /** + * @param int[] $assistingParticipantIds + * + * @return $this + */ + public function setAssistingParticipantIds($assistingParticipantIds) + { + $this->assistingParticipantIds = $assistingParticipantIds; + + return $this; + } + + /** + * @param string $wardType + * + * @return $this + */ + public function setWardType($wardType) + { + $this->wardType = $wardType; + + return $this; + } + + /** + * @param string $monsterType + * + * @return $this + */ + public function setMonsterType($monsterType) + { + $this->monsterType = $monsterType; + + return $this; + } + + /** + * @param Type $type + * + * @return $this + */ + public function setType($type) + { + $this->type = $type; + + return $this; + } + + /** + * @param int $skillSlot + * + * @return $this + */ + public function setSkillSlot($skillSlot) + { + $this->skillSlot = $skillSlot; + + return $this; + } + + /** + * @param int $victimId + * + * @return $this + */ + public function setVictimId($victimId) + { + $this->victimId = $victimId; + + return $this; + } + + /** + * @param double $timestamp + * + * @return $this + */ + public function setTimestamp($timestamp) + { + $this->timestamp = $timestamp; + + return $this; + } + + /** + * @param int $afterId + * + * @return $this + */ + public function setAfterId($afterId) + { + $this->afterId = $afterId; + + return $this; + } + + /** + * @param string $monsterSubType + * + * @return $this + */ + public function setMonsterSubType($monsterSubType) + { + $this->monsterSubType = $monsterSubType; + + return $this; + } + + /** + * @param string $laneType + * + * @return $this + */ + public function setLaneType($laneType) + { + $this->laneType = $laneType; + + return $this; + } + + /** + * @param int $itemId + * + * @return $this + */ + public function setItemId($itemId) + { + $this->itemId = $itemId; + + return $this; + } + + /** + * @param int $participantId + * + * @return $this + */ + public function setParticipantId($participantId) + { + $this->participantId = $participantId; + + return $this; + } + + /** + * @param string $buildingType + * + * @return $this + */ + public function setBuildingType($buildingType) + { + $this->buildingType = $buildingType; + + return $this; + } + + /** + * @param int $creatorId + * + * @return $this + */ + public function setCreatorId($creatorId) + { + $this->creatorId = $creatorId; + + return $this; + } + + /** + * @param MatchPositionDto $position + * + * @return $this + */ + public function setPosition($position) + { + $this->position = new MatchPositionDto($position); + + return $this; + } + + /** + * @param int $beforeId + * + * @return $this + */ + public function setBeforeId($beforeId) + { + $this->beforeId = $beforeId; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/MatchFrameDto.php b/src/LeagueWrap/Api/Dto/MatchFrameDto.php new file mode 100644 index 0000000..dd0deea --- /dev/null +++ b/src/LeagueWrap/Api/Dto/MatchFrameDto.php @@ -0,0 +1,85 @@ +timestamp; + } + + /** + * @return ParticipantFrame[] + */ + public function getParticipantFrames() + { + return $this->participantFrames; + } + + /** + * @return MatchEventDto[] + */ + public function getEvents() + { + return $this->events; + } + + /** + * @param double $timestamp + * + * @return $this + */ + public function setTimestamp($timestamp) + { + $this->timestamp = $timestamp; + + return $this; + } + + /** + * @param ParticipantFrame[] $participantFrames Map[int, ParticipantFrame] + * + * @return $this + */ + public function setParticipantFrames($participantFrames) + { + $this->participantFrames = $participantFrames; + + return $this; + } + + /** + * @param MatchEventDto[] $events + * + * @return $this + */ + public function setEvents($events) + { + foreach ($events as $key => $dtoData) { + $this->events[$key] = new MatchEventDto($dtoData); + } + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/MatchParticipantFrameDto.php b/src/LeagueWrap/Api/Dto/MatchParticipantFrameDto.php new file mode 100644 index 0000000..6ef351c --- /dev/null +++ b/src/LeagueWrap/Api/Dto/MatchParticipantFrameDto.php @@ -0,0 +1,244 @@ +totalGold; + } + + /** + * @return int + */ + public function getTeamScore() + { + return $this->teamScore; + } + + /** + * @return int + */ + public function getParticipantId() + { + return $this->participantId; + } + + /** + * @return int + */ + public function getLevel() + { + return $this->level; + } + + /** + * @return int + */ + public function getCurrentGold() + { + return $this->currentGold; + } + + /** + * @return int + */ + public function getMinionsKilled() + { + return $this->minionsKilled; + } + + /** + * @return int + */ + public function getDominionScore() + { + return $this->dominionScore; + } + + /** + * @return MatchPositionDto + */ + public function getPosition() + { + return $this->position; + } + + /** + * @return int + */ + public function getXp() + { + return $this->xp; + } + + /** + * @return int + */ + public function getJungleMinionsKilled() + { + return $this->jungleMinionsKilled; + } + + /** + * @param int $totalGold + * + * @return $this + */ + public function setTotalGold($totalGold) + { + $this->totalGold = $totalGold; + + return $this; + } + + /** + * @param int $teamScore + * + * @return $this + */ + public function setTeamScore($teamScore) + { + $this->teamScore = $teamScore; + + return $this; + } + + /** + * @param int $participantId + * + * @return $this + */ + public function setParticipantId($participantId) + { + $this->participantId = $participantId; + + return $this; + } + + /** + * @param int $level + * + * @return $this + */ + public function setLevel($level) + { + $this->level = $level; + + return $this; + } + + /** + * @param int $currentGold + * + * @return $this + */ + public function setCurrentGold($currentGold) + { + $this->currentGold = $currentGold; + + return $this; + } + + /** + * @param int $minionsKilled + * + * @return $this + */ + public function setMinionsKilled($minionsKilled) + { + $this->minionsKilled = $minionsKilled; + + return $this; + } + + /** + * @param int $dominionScore + * + * @return $this + */ + public function setDominionScore($dominionScore) + { + $this->dominionScore = $dominionScore; + + return $this; + } + + /** + * @param MatchPositionDto $position + * + * @return $this + */ + public function setPosition($position) + { + $this->position = new MatchPositionDto($position); + + return $this; + } + + /** + * @param int $xp + * + * @return $this + */ + public function setXp($xp) + { + $this->xp = $xp; + + return $this; + } + + /** + * @param int $jungleMinionsKilled + * + * @return $this + */ + public function setJungleMinionsKilled($jungleMinionsKilled) + { + $this->jungleMinionsKilled = $jungleMinionsKilled; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/MatchPositionDto.php b/src/LeagueWrap/Api/Dto/MatchPositionDto.php new file mode 100644 index 0000000..8a108b6 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/MatchPositionDto.php @@ -0,0 +1,60 @@ +y; + } + + /** + * @return int + */ + public function getX() + { + return $this->x; + } + + /** + * @param int $y + * + * @return $this + */ + public function setY($y) + { + $this->y = $y; + + return $this; + } + + /** + * @param int $x + * + * @return $this + */ + public function setX($x) + { + $this->x = $x; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/MatchReferenceDto.php b/src/LeagueWrap/Api/Dto/MatchReferenceDto.php new file mode 100644 index 0000000..8d9a7d5 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/MatchReferenceDto.php @@ -0,0 +1,198 @@ +lane; + } + + /** + * @return double + */ + public function getGameId() + { + return $this->gameId; + } + + /** + * @return int + */ + public function getChampion() + { + return $this->champion; + } + + /** + * @return string + */ + public function getPlatformId() + { + return $this->platformId; + } + + /** + * @return int + */ + public function getSeason() + { + return $this->season; + } + + /** + * @return int + */ + public function getQueue() + { + return $this->queue; + } + + /** + * @return string + */ + public function getRole() + { + return $this->role; + } + + /** + * @return double + */ + public function getTimestamp() + { + return $this->timestamp; + } + + /** + * @param string $lane + * + * @return $this + */ + public function setLane($lane) + { + $this->lane = $lane; + + return $this; + } + + /** + * @param double $gameId + * + * @return $this + */ + public function setGameId($gameId) + { + $this->gameId = $gameId; + + return $this; + } + + /** + * @param int $champion + * + * @return $this + */ + public function setChampion($champion) + { + $this->champion = $champion; + + return $this; + } + + /** + * @param string $platformId + * + * @return $this + */ + public function setPlatformId($platformId) + { + $this->platformId = $platformId; + + return $this; + } + + /** + * @param int $season + * + * @return $this + */ + public function setSeason($season) + { + $this->season = $season; + + return $this; + } + + /** + * @param int $queue + * + * @return $this + */ + public function setQueue($queue) + { + $this->queue = $queue; + + return $this; + } + + /** + * @param string $role + * + * @return $this + */ + public function setRole($role) + { + $this->role = $role; + + return $this; + } + + /** + * @param double $timestamp + * + * @return $this + */ + public function setTimestamp($timestamp) + { + $this->timestamp = $timestamp; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/MatchTimelineDto.php b/src/LeagueWrap/Api/Dto/MatchTimelineDto.php new file mode 100644 index 0000000..41664f9 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/MatchTimelineDto.php @@ -0,0 +1,62 @@ +frames; + } + + /** + * @return double + */ + public function getFrameInterval() + { + return $this->frameInterval; + } + + /** + * @param MatchFrameDto[] $frames + * + * @return $this + */ + public function setFrames($frames) + { + foreach ($frames as $key => $dtoData) { + $this->frames[$key] = new MatchFrameDto($dtoData); + } + + return $this; + } + + /** + * @param double $frameInterval + * + * @return $this + */ + public function setFrameInterval($frameInterval) + { + $this->frameInterval = $frameInterval; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/MatchlistDto.php b/src/LeagueWrap/Api/Dto/MatchlistDto.php new file mode 100644 index 0000000..2a3999a --- /dev/null +++ b/src/LeagueWrap/Api/Dto/MatchlistDto.php @@ -0,0 +1,108 @@ +matches; + } + + /** + * @return int + */ + public function getTotalGames() + { + return $this->totalGames; + } + + /** + * @return int + */ + public function getStartIndex() + { + return $this->startIndex; + } + + /** + * @return int + */ + public function getEndIndex() + { + return $this->endIndex; + } + + /** + * @param MatchReferenceDto[] $matches + * + * @return $this + */ + public function setMatches($matches) + { + foreach ($matches as $key => $dtoData) { + $this->matches[$key] = new MatchReferenceDto($dtoData); + } + + return $this; + } + + /** + * @param int $totalGames + * + * @return $this + */ + public function setTotalGames($totalGames) + { + $this->totalGames = $totalGames; + + return $this; + } + + /** + * @param int $startIndex + * + * @return $this + */ + public function setStartIndex($startIndex) + { + $this->startIndex = $startIndex; + + return $this; + } + + /** + * @param int $endIndex + * + * @return $this + */ + public function setEndIndex($endIndex) + { + $this->endIndex = $endIndex; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/Message.php b/src/LeagueWrap/Api/Dto/Message.php new file mode 100644 index 0000000..75a4c79 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/Message.php @@ -0,0 +1,175 @@ +severity; + } + + /** + * @return string + */ + public function getAuthor() + { + return $this->author; + } + + /** + * @return string + */ + public function getCreated_at() + { + return $this->created_at; + } + + /** + * @return Translation[] + */ + public function getTranslations() + { + return $this->translations; + } + + /** + * @return string + */ + public function getUpdated_at() + { + return $this->updated_at; + } + + /** + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * @param string $severity + * + * @return $this + */ + public function setSeverity($severity) + { + $this->severity = $severity; + + return $this; + } + + /** + * @param string $author + * + * @return $this + */ + public function setAuthor($author) + { + $this->author = $author; + + return $this; + } + + /** + * @param string $created_at + * + * @return $this + */ + public function setCreated_at($created_at) + { + $this->created_at = $created_at; + + return $this; + } + + /** + * @param Translation[] $translations + * + * @return $this + */ + public function setTranslations($translations) + { + $this->translations = $translations; + + return $this; + } + + /** + * @param string $updated_at + * + * @return $this + */ + public function setUpdated_at($updated_at) + { + $this->updated_at = $updated_at; + + return $this; + } + + /** + * @param string $content + * + * @return $this + */ + public function setContent($content) + { + $this->content = $content; + + return $this; + } + + /** + * @param string $id + * + * @return $this + */ + public function setId($id) + { + $this->id = $id; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/MetaDataDto.php b/src/LeagueWrap/Api/Dto/MetaDataDto.php new file mode 100644 index 0000000..7ede0a2 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/MetaDataDto.php @@ -0,0 +1,83 @@ +tier; + } + + /** + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * @return bool + */ + public function isIsRune() + { + return $this->isRune; + } + + /** + * @param string $tier + * + * @return $this + */ + public function setTier($tier) + { + $this->tier = $tier; + + return $this; + } + + /** + * @param string $type + * + * @return $this + */ + public function setType($type) + { + $this->type = $type; + + return $this; + } + + /** + * @param bool $isRune + * + * @return $this + */ + public function setIsRune($isRune) + { + $this->isRune = $isRune; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/MiniSeriesDto.php b/src/LeagueWrap/Api/Dto/MiniSeriesDto.php new file mode 100644 index 0000000..8071218 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/MiniSeriesDto.php @@ -0,0 +1,106 @@ +wins; + } + + /** + * @return int + */ + public function getLosses() + { + return $this->losses; + } + + /** + * @return int + */ + public function getTarget() + { + return $this->target; + } + + /** + * @return string + */ + public function getProgress() + { + return $this->progress; + } + + /** + * @param int $wins + * + * @return $this + */ + public function setWins($wins) + { + $this->wins = $wins; + + return $this; + } + + /** + * @param int $losses + * + * @return $this + */ + public function setLosses($losses) + { + $this->losses = $losses; + + return $this; + } + + /** + * @param int $target + * + * @return $this + */ + public function setTarget($target) + { + $this->target = $target; + + return $this; + } + + /** + * @param string $progress + * + * @return $this + */ + public function setProgress($progress) + { + $this->progress = $progress; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/Observer.php b/src/LeagueWrap/Api/Dto/Observer.php new file mode 100644 index 0000000..89e18ba --- /dev/null +++ b/src/LeagueWrap/Api/Dto/Observer.php @@ -0,0 +1,37 @@ +encryptionKey; + } + + /** + * @param string $encryptionKey + * + * @return $this + */ + public function setEncryptionKey($encryptionKey) + { + $this->encryptionKey = $encryptionKey; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/Participant.php b/src/LeagueWrap/Api/Dto/Participant.php new file mode 100644 index 0000000..eab7103 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/Participant.php @@ -0,0 +1,175 @@ +profileIconId; + } + + /** + * @return double + */ + public function getChampionId() + { + return $this->championId; + } + + /** + * @return string + */ + public function getSummonerName() + { + return $this->summonerName; + } + + /** + * @return bool + */ + public function isBot() + { + return $this->bot; + } + + /** + * @return double + */ + public function getSpell2Id() + { + return $this->spell2Id; + } + + /** + * @return double + */ + public function getTeamId() + { + return $this->teamId; + } + + /** + * @return double + */ + public function getSpell1Id() + { + return $this->spell1Id; + } + + /** + * @param double $profileIconId + * + * @return $this + */ + public function setProfileIconId($profileIconId) + { + $this->profileIconId = $profileIconId; + + return $this; + } + + /** + * @param double $championId + * + * @return $this + */ + public function setChampionId($championId) + { + $this->championId = $championId; + + return $this; + } + + /** + * @param string $summonerName + * + * @return $this + */ + public function setSummonerName($summonerName) + { + $this->summonerName = $summonerName; + + return $this; + } + + /** + * @param bool $bot + * + * @return $this + */ + public function setBot($bot) + { + $this->bot = $bot; + + return $this; + } + + /** + * @param double $spell2Id + * + * @return $this + */ + public function setSpell2Id($spell2Id) + { + $this->spell2Id = $spell2Id; + + return $this; + } + + /** + * @param double $teamId + * + * @return $this + */ + public function setTeamId($teamId) + { + $this->teamId = $teamId; + + return $this; + } + + /** + * @param double $spell1Id + * + * @return $this + */ + public function setSpell1Id($spell1Id) + { + $this->spell1Id = $spell1Id; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/ParticipantDto.php b/src/LeagueWrap/Api/Dto/ParticipantDto.php new file mode 100644 index 0000000..2e2a5c3 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/ParticipantDto.php @@ -0,0 +1,248 @@ +stats; + } + + /** + * @return int + */ + public function getParticipantId() + { + return $this->participantId; + } + + /** + * @return RuneDto[] + */ + public function getRunes() + { + return $this->runes; + } + + /** + * @return ParticipantTimelineDto + */ + public function getTimeline() + { + return $this->timeline; + } + + /** + * @return int + */ + public function getTeamId() + { + return $this->teamId; + } + + /** + * @return int + */ + public function getSpell2Id() + { + return $this->spell2Id; + } + + /** + * @return MasteryDto[] + */ + public function getMasteries() + { + return $this->masteries; + } + + /** + * @return string + */ + public function getHighestAchievedSeasonTier() + { + return $this->highestAchievedSeasonTier; + } + + /** + * @return int + */ + public function getSpell1Id() + { + return $this->spell1Id; + } + + /** + * @return int + */ + public function getChampionId() + { + return $this->championId; + } + + /** + * @param ParticipantStatsDto $stats + * + * @return $this + */ + public function setStats($stats) + { + $this->stats = new ParticipantStatsDto($stats); + + return $this; + } + + /** + * @param int $participantId + * + * @return $this + */ + public function setParticipantId($participantId) + { + $this->participantId = $participantId; + + return $this; + } + + /** + * @param RuneDto[] $runes + * + * @return $this + */ + public function setRunes($runes) + { + foreach ($runes as $key => $dtoData) { + $this->runes[$key] = new RuneDto($dtoData); + } + + return $this; + } + + /** + * @param ParticipantTimelineDto $timeline + * + * @return $this + */ + public function setTimeline($timeline) + { + $this->timeline = new ParticipantTimelineDto($timeline); + + return $this; + } + + /** + * @param int $teamId + * + * @return $this + */ + public function setTeamId($teamId) + { + $this->teamId = $teamId; + + return $this; + } + + /** + * @param int $spell2Id + * + * @return $this + */ + public function setSpell2Id($spell2Id) + { + $this->spell2Id = $spell2Id; + + return $this; + } + + /** + * @param MasteryDto[] $masteries + * + * @return $this + */ + public function setMasteries($masteries) + { + foreach ($masteries as $key => $dtoData) { + $this->masteries[$key] = new MasteryDto($dtoData); + } + + return $this; + } + + /** + * @param string $highestAchievedSeasonTier + * + * @return $this + */ + public function setHighestAchievedSeasonTier($highestAchievedSeasonTier) + { + $this->highestAchievedSeasonTier = $highestAchievedSeasonTier; + + return $this; + } + + /** + * @param int $spell1Id + * + * @return $this + */ + public function setSpell1Id($spell1Id) + { + $this->spell1Id = $spell1Id; + + return $this; + } + + /** + * @param int $championId + * + * @return $this + */ + public function setChampionId($championId) + { + $this->championId = $championId; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/ParticipantIdentityDto.php b/src/LeagueWrap/Api/Dto/ParticipantIdentityDto.php new file mode 100644 index 0000000..210631d --- /dev/null +++ b/src/LeagueWrap/Api/Dto/ParticipantIdentityDto.php @@ -0,0 +1,60 @@ +player; + } + + /** + * @return int + */ + public function getParticipantId() + { + return $this->participantId; + } + + /** + * @param PlayerDto $player + * + * @return $this + */ + public function setPlayer($player) + { + $this->player = new PlayerDto($player); + + return $this; + } + + /** + * @param int $participantId + * + * @return $this + */ + public function setParticipantId($participantId) + { + $this->participantId = $participantId; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/ParticipantStatsDto.php b/src/LeagueWrap/Api/Dto/ParticipantStatsDto.php new file mode 100644 index 0000000..c41a377 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/ParticipantStatsDto.php @@ -0,0 +1,1670 @@ +physicalDamageDealt; + } + + /** + * @return int + */ + public function getNeutralMinionsKilledTeamJungle() + { + return $this->neutralMinionsKilledTeamJungle; + } + + /** + * @return double + */ + public function getMagicDamageDealt() + { + return $this->magicDamageDealt; + } + + /** + * @return int + */ + public function getTotalPlayerScore() + { + return $this->totalPlayerScore; + } + + /** + * @return int + */ + public function getDeaths() + { + return $this->deaths; + } + + /** + * @return bool + */ + public function isWin() + { + return $this->win; + } + + /** + * @return int + */ + public function getNeutralMinionsKilledEnemyJungle() + { + return $this->neutralMinionsKilledEnemyJungle; + } + + /** + * @return int + */ + public function getAltarsCaptured() + { + return $this->altarsCaptured; + } + + /** + * @return int + */ + public function getLargestCriticalStrike() + { + return $this->largestCriticalStrike; + } + + /** + * @return double + */ + public function getTotalDamageDealt() + { + return $this->totalDamageDealt; + } + + /** + * @return double + */ + public function getMagicDamageDealtToChampions() + { + return $this->magicDamageDealtToChampions; + } + + /** + * @return int + */ + public function getVisionWardsBoughtInGame() + { + return $this->visionWardsBoughtInGame; + } + + /** + * @return double + */ + public function getDamageDealtToObjectives() + { + return $this->damageDealtToObjectives; + } + + /** + * @return int + */ + public function getLargestKillingSpree() + { + return $this->largestKillingSpree; + } + + /** + * @return int + */ + public function getItem1() + { + return $this->item1; + } + + /** + * @return int + */ + public function getQuadraKills() + { + return $this->quadraKills; + } + + /** + * @return int + */ + public function getTeamObjective() + { + return $this->teamObjective; + } + + /** + * @return int + */ + public function getTotalTimeCrowdControlDealt() + { + return $this->totalTimeCrowdControlDealt; + } + + /** + * @return int + */ + public function getLongestTimeSpentLiving() + { + return $this->longestTimeSpentLiving; + } + + /** + * @return int + */ + public function getWardsKilled() + { + return $this->wardsKilled; + } + + /** + * @return bool + */ + public function isFirstTowerAssist() + { + return $this->firstTowerAssist; + } + + /** + * @return bool + */ + public function isFirstTowerKill() + { + return $this->firstTowerKill; + } + + /** + * @return int + */ + public function getItem2() + { + return $this->item2; + } + + /** + * @return int + */ + public function getItem3() + { + return $this->item3; + } + + /** + * @return int + */ + public function getItem0() + { + return $this->item0; + } + + /** + * @return bool + */ + public function isFirstBloodAssist() + { + return $this->firstBloodAssist; + } + + /** + * @return double + */ + public function getVisionScore() + { + return $this->visionScore; + } + + /** + * @return int + */ + public function getWardsPlaced() + { + return $this->wardsPlaced; + } + + /** + * @return int + */ + public function getItem4() + { + return $this->item4; + } + + /** + * @return int + */ + public function getItem5() + { + return $this->item5; + } + + /** + * @return int + */ + public function getItem6() + { + return $this->item6; + } + + /** + * @return int + */ + public function getTurretKills() + { + return $this->turretKills; + } + + /** + * @return int + */ + public function getTripleKills() + { + return $this->tripleKills; + } + + /** + * @return double + */ + public function getDamageSelfMitigated() + { + return $this->damageSelfMitigated; + } + + /** + * @return int + */ + public function getChampLevel() + { + return $this->champLevel; + } + + /** + * @return int + */ + public function getNodeNeutralizeAssist() + { + return $this->nodeNeutralizeAssist; + } + + /** + * @return bool + */ + public function isFirstInhibitorKill() + { + return $this->firstInhibitorKill; + } + + /** + * @return int + */ + public function getGoldEarned() + { + return $this->goldEarned; + } + + /** + * @return double + */ + public function getMagicalDamageTaken() + { + return $this->magicalDamageTaken; + } + + /** + * @return int + */ + public function getKills() + { + return $this->kills; + } + + /** + * @return int + */ + public function getDoubleKills() + { + return $this->doubleKills; + } + + /** + * @return int + */ + public function getNodeCaptureAssist() + { + return $this->nodeCaptureAssist; + } + + /** + * @return double + */ + public function getTrueDamageTaken() + { + return $this->trueDamageTaken; + } + + /** + * @return int + */ + public function getNodeNeutralize() + { + return $this->nodeNeutralize; + } + + /** + * @return bool + */ + public function isFirstInhibitorAssist() + { + return $this->firstInhibitorAssist; + } + + /** + * @return int + */ + public function getAssists() + { + return $this->assists; + } + + /** + * @return int + */ + public function getUnrealKills() + { + return $this->unrealKills; + } + + /** + * @return int + */ + public function getNeutralMinionsKilled() + { + return $this->neutralMinionsKilled; + } + + /** + * @return int + */ + public function getObjectivePlayerScore() + { + return $this->objectivePlayerScore; + } + + /** + * @return int + */ + public function getCombatPlayerScore() + { + return $this->combatPlayerScore; + } + + /** + * @return double + */ + public function getDamageDealtToTurrets() + { + return $this->damageDealtToTurrets; + } + + /** + * @return int + */ + public function getAltarsNeutralized() + { + return $this->altarsNeutralized; + } + + /** + * @return double + */ + public function getPhysicalDamageDealtToChampions() + { + return $this->physicalDamageDealtToChampions; + } + + /** + * @return int + */ + public function getGoldSpent() + { + return $this->goldSpent; + } + + /** + * @return double + */ + public function getTrueDamageDealt() + { + return $this->trueDamageDealt; + } + + /** + * @return double + */ + public function getTrueDamageDealtToChampions() + { + return $this->trueDamageDealtToChampions; + } + + /** + * @return int + */ + public function getParticipantId() + { + return $this->participantId; + } + + /** + * @return int + */ + public function getPentaKills() + { + return $this->pentaKills; + } + + /** + * @return double + */ + public function getTotalHeal() + { + return $this->totalHeal; + } + + /** + * @return int + */ + public function getTotalMinionsKilled() + { + return $this->totalMinionsKilled; + } + + /** + * @return bool + */ + public function isFirstBloodKill() + { + return $this->firstBloodKill; + } + + /** + * @return int + */ + public function getNodeCapture() + { + return $this->nodeCapture; + } + + /** + * @return int + */ + public function getLargestMultiKill() + { + return $this->largestMultiKill; + } + + /** + * @return int + */ + public function getSightWardsBoughtInGame() + { + return $this->sightWardsBoughtInGame; + } + + /** + * @return double + */ + public function getTotalDamageDealtToChampions() + { + return $this->totalDamageDealtToChampions; + } + + /** + * @return int + */ + public function getTotalUnitsHealed() + { + return $this->totalUnitsHealed; + } + + /** + * @return int + */ + public function getInhibitorKills() + { + return $this->inhibitorKills; + } + + /** + * @return int + */ + public function getTotalScoreRank() + { + return $this->totalScoreRank; + } + + /** + * @return double + */ + public function getTotalDamageTaken() + { + return $this->totalDamageTaken; + } + + /** + * @return int + */ + public function getKillingSprees() + { + return $this->killingSprees; + } + + /** + * @return double + */ + public function getTimeCCingOthers() + { + return $this->timeCCingOthers; + } + + /** + * @return double + */ + public function getPhysicalDamageTaken() + { + return $this->physicalDamageTaken; + } + + /** + * @param double $physicalDamageDealt + * + * @return $this + */ + public function setPhysicalDamageDealt($physicalDamageDealt) + { + $this->physicalDamageDealt = $physicalDamageDealt; + + return $this; + } + + /** + * @param int $neutralMinionsKilledTeamJungle + * + * @return $this + */ + public function setNeutralMinionsKilledTeamJungle($neutralMinionsKilledTeamJungle) + { + $this->neutralMinionsKilledTeamJungle = $neutralMinionsKilledTeamJungle; + + return $this; + } + + /** + * @param double $magicDamageDealt + * + * @return $this + */ + public function setMagicDamageDealt($magicDamageDealt) + { + $this->magicDamageDealt = $magicDamageDealt; + + return $this; + } + + /** + * @param int $totalPlayerScore + * + * @return $this + */ + public function setTotalPlayerScore($totalPlayerScore) + { + $this->totalPlayerScore = $totalPlayerScore; + + return $this; + } + + /** + * @param int $deaths + * + * @return $this + */ + public function setDeaths($deaths) + { + $this->deaths = $deaths; + + return $this; + } + + /** + * @param bool $win + * + * @return $this + */ + public function setWin($win) + { + $this->win = $win; + + return $this; + } + + /** + * @param int $neutralMinionsKilledEnemyJungle + * + * @return $this + */ + public function setNeutralMinionsKilledEnemyJungle($neutralMinionsKilledEnemyJungle) + { + $this->neutralMinionsKilledEnemyJungle = $neutralMinionsKilledEnemyJungle; + + return $this; + } + + /** + * @param int $altarsCaptured + * + * @return $this + */ + public function setAltarsCaptured($altarsCaptured) + { + $this->altarsCaptured = $altarsCaptured; + + return $this; + } + + /** + * @param int $largestCriticalStrike + * + * @return $this + */ + public function setLargestCriticalStrike($largestCriticalStrike) + { + $this->largestCriticalStrike = $largestCriticalStrike; + + return $this; + } + + /** + * @param double $totalDamageDealt + * + * @return $this + */ + public function setTotalDamageDealt($totalDamageDealt) + { + $this->totalDamageDealt = $totalDamageDealt; + + return $this; + } + + /** + * @param double $magicDamageDealtToChampions + * + * @return $this + */ + public function setMagicDamageDealtToChampions($magicDamageDealtToChampions) + { + $this->magicDamageDealtToChampions = $magicDamageDealtToChampions; + + return $this; + } + + /** + * @param int $visionWardsBoughtInGame + * + * @return $this + */ + public function setVisionWardsBoughtInGame($visionWardsBoughtInGame) + { + $this->visionWardsBoughtInGame = $visionWardsBoughtInGame; + + return $this; + } + + /** + * @param double $damageDealtToObjectives + * + * @return $this + */ + public function setDamageDealtToObjectives($damageDealtToObjectives) + { + $this->damageDealtToObjectives = $damageDealtToObjectives; + + return $this; + } + + /** + * @param int $largestKillingSpree + * + * @return $this + */ + public function setLargestKillingSpree($largestKillingSpree) + { + $this->largestKillingSpree = $largestKillingSpree; + + return $this; + } + + /** + * @param int $item1 + * + * @return $this + */ + public function setItem1($item1) + { + $this->item1 = $item1; + + return $this; + } + + /** + * @param int $quadraKills + * + * @return $this + */ + public function setQuadraKills($quadraKills) + { + $this->quadraKills = $quadraKills; + + return $this; + } + + /** + * @param int $teamObjective + * + * @return $this + */ + public function setTeamObjective($teamObjective) + { + $this->teamObjective = $teamObjective; + + return $this; + } + + /** + * @param int $totalTimeCrowdControlDealt + * + * @return $this + */ + public function setTotalTimeCrowdControlDealt($totalTimeCrowdControlDealt) + { + $this->totalTimeCrowdControlDealt = $totalTimeCrowdControlDealt; + + return $this; + } + + /** + * @param int $longestTimeSpentLiving + * + * @return $this + */ + public function setLongestTimeSpentLiving($longestTimeSpentLiving) + { + $this->longestTimeSpentLiving = $longestTimeSpentLiving; + + return $this; + } + + /** + * @param int $wardsKilled + * + * @return $this + */ + public function setWardsKilled($wardsKilled) + { + $this->wardsKilled = $wardsKilled; + + return $this; + } + + /** + * @param bool $firstTowerAssist + * + * @return $this + */ + public function setFirstTowerAssist($firstTowerAssist) + { + $this->firstTowerAssist = $firstTowerAssist; + + return $this; + } + + /** + * @param bool $firstTowerKill + * + * @return $this + */ + public function setFirstTowerKill($firstTowerKill) + { + $this->firstTowerKill = $firstTowerKill; + + return $this; + } + + /** + * @param int $item2 + * + * @return $this + */ + public function setItem2($item2) + { + $this->item2 = $item2; + + return $this; + } + + /** + * @param int $item3 + * + * @return $this + */ + public function setItem3($item3) + { + $this->item3 = $item3; + + return $this; + } + + /** + * @param int $item0 + * + * @return $this + */ + public function setItem0($item0) + { + $this->item0 = $item0; + + return $this; + } + + /** + * @param bool $firstBloodAssist + * + * @return $this + */ + public function setFirstBloodAssist($firstBloodAssist) + { + $this->firstBloodAssist = $firstBloodAssist; + + return $this; + } + + /** + * @param double $visionScore + * + * @return $this + */ + public function setVisionScore($visionScore) + { + $this->visionScore = $visionScore; + + return $this; + } + + /** + * @param int $wardsPlaced + * + * @return $this + */ + public function setWardsPlaced($wardsPlaced) + { + $this->wardsPlaced = $wardsPlaced; + + return $this; + } + + /** + * @param int $item4 + * + * @return $this + */ + public function setItem4($item4) + { + $this->item4 = $item4; + + return $this; + } + + /** + * @param int $item5 + * + * @return $this + */ + public function setItem5($item5) + { + $this->item5 = $item5; + + return $this; + } + + /** + * @param int $item6 + * + * @return $this + */ + public function setItem6($item6) + { + $this->item6 = $item6; + + return $this; + } + + /** + * @param int $turretKills + * + * @return $this + */ + public function setTurretKills($turretKills) + { + $this->turretKills = $turretKills; + + return $this; + } + + /** + * @param int $tripleKills + * + * @return $this + */ + public function setTripleKills($tripleKills) + { + $this->tripleKills = $tripleKills; + + return $this; + } + + /** + * @param double $damageSelfMitigated + * + * @return $this + */ + public function setDamageSelfMitigated($damageSelfMitigated) + { + $this->damageSelfMitigated = $damageSelfMitigated; + + return $this; + } + + /** + * @param int $champLevel + * + * @return $this + */ + public function setChampLevel($champLevel) + { + $this->champLevel = $champLevel; + + return $this; + } + + /** + * @param int $nodeNeutralizeAssist + * + * @return $this + */ + public function setNodeNeutralizeAssist($nodeNeutralizeAssist) + { + $this->nodeNeutralizeAssist = $nodeNeutralizeAssist; + + return $this; + } + + /** + * @param bool $firstInhibitorKill + * + * @return $this + */ + public function setFirstInhibitorKill($firstInhibitorKill) + { + $this->firstInhibitorKill = $firstInhibitorKill; + + return $this; + } + + /** + * @param int $goldEarned + * + * @return $this + */ + public function setGoldEarned($goldEarned) + { + $this->goldEarned = $goldEarned; + + return $this; + } + + /** + * @param double $magicalDamageTaken + * + * @return $this + */ + public function setMagicalDamageTaken($magicalDamageTaken) + { + $this->magicalDamageTaken = $magicalDamageTaken; + + return $this; + } + + /** + * @param int $kills + * + * @return $this + */ + public function setKills($kills) + { + $this->kills = $kills; + + return $this; + } + + /** + * @param int $doubleKills + * + * @return $this + */ + public function setDoubleKills($doubleKills) + { + $this->doubleKills = $doubleKills; + + return $this; + } + + /** + * @param int $nodeCaptureAssist + * + * @return $this + */ + public function setNodeCaptureAssist($nodeCaptureAssist) + { + $this->nodeCaptureAssist = $nodeCaptureAssist; + + return $this; + } + + /** + * @param double $trueDamageTaken + * + * @return $this + */ + public function setTrueDamageTaken($trueDamageTaken) + { + $this->trueDamageTaken = $trueDamageTaken; + + return $this; + } + + /** + * @param int $nodeNeutralize + * + * @return $this + */ + public function setNodeNeutralize($nodeNeutralize) + { + $this->nodeNeutralize = $nodeNeutralize; + + return $this; + } + + /** + * @param bool $firstInhibitorAssist + * + * @return $this + */ + public function setFirstInhibitorAssist($firstInhibitorAssist) + { + $this->firstInhibitorAssist = $firstInhibitorAssist; + + return $this; + } + + /** + * @param int $assists + * + * @return $this + */ + public function setAssists($assists) + { + $this->assists = $assists; + + return $this; + } + + /** + * @param int $unrealKills + * + * @return $this + */ + public function setUnrealKills($unrealKills) + { + $this->unrealKills = $unrealKills; + + return $this; + } + + /** + * @param int $neutralMinionsKilled + * + * @return $this + */ + public function setNeutralMinionsKilled($neutralMinionsKilled) + { + $this->neutralMinionsKilled = $neutralMinionsKilled; + + return $this; + } + + /** + * @param int $objectivePlayerScore + * + * @return $this + */ + public function setObjectivePlayerScore($objectivePlayerScore) + { + $this->objectivePlayerScore = $objectivePlayerScore; + + return $this; + } + + /** + * @param int $combatPlayerScore + * + * @return $this + */ + public function setCombatPlayerScore($combatPlayerScore) + { + $this->combatPlayerScore = $combatPlayerScore; + + return $this; + } + + /** + * @param double $damageDealtToTurrets + * + * @return $this + */ + public function setDamageDealtToTurrets($damageDealtToTurrets) + { + $this->damageDealtToTurrets = $damageDealtToTurrets; + + return $this; + } + + /** + * @param int $altarsNeutralized + * + * @return $this + */ + public function setAltarsNeutralized($altarsNeutralized) + { + $this->altarsNeutralized = $altarsNeutralized; + + return $this; + } + + /** + * @param double $physicalDamageDealtToChampions + * + * @return $this + */ + public function setPhysicalDamageDealtToChampions($physicalDamageDealtToChampions) + { + $this->physicalDamageDealtToChampions = $physicalDamageDealtToChampions; + + return $this; + } + + /** + * @param int $goldSpent + * + * @return $this + */ + public function setGoldSpent($goldSpent) + { + $this->goldSpent = $goldSpent; + + return $this; + } + + /** + * @param double $trueDamageDealt + * + * @return $this + */ + public function setTrueDamageDealt($trueDamageDealt) + { + $this->trueDamageDealt = $trueDamageDealt; + + return $this; + } + + /** + * @param double $trueDamageDealtToChampions + * + * @return $this + */ + public function setTrueDamageDealtToChampions($trueDamageDealtToChampions) + { + $this->trueDamageDealtToChampions = $trueDamageDealtToChampions; + + return $this; + } + + /** + * @param int $participantId + * + * @return $this + */ + public function setParticipantId($participantId) + { + $this->participantId = $participantId; + + return $this; + } + + /** + * @param int $pentaKills + * + * @return $this + */ + public function setPentaKills($pentaKills) + { + $this->pentaKills = $pentaKills; + + return $this; + } + + /** + * @param double $totalHeal + * + * @return $this + */ + public function setTotalHeal($totalHeal) + { + $this->totalHeal = $totalHeal; + + return $this; + } + + /** + * @param int $totalMinionsKilled + * + * @return $this + */ + public function setTotalMinionsKilled($totalMinionsKilled) + { + $this->totalMinionsKilled = $totalMinionsKilled; + + return $this; + } + + /** + * @param bool $firstBloodKill + * + * @return $this + */ + public function setFirstBloodKill($firstBloodKill) + { + $this->firstBloodKill = $firstBloodKill; + + return $this; + } + + /** + * @param int $nodeCapture + * + * @return $this + */ + public function setNodeCapture($nodeCapture) + { + $this->nodeCapture = $nodeCapture; + + return $this; + } + + /** + * @param int $largestMultiKill + * + * @return $this + */ + public function setLargestMultiKill($largestMultiKill) + { + $this->largestMultiKill = $largestMultiKill; + + return $this; + } + + /** + * @param int $sightWardsBoughtInGame + * + * @return $this + */ + public function setSightWardsBoughtInGame($sightWardsBoughtInGame) + { + $this->sightWardsBoughtInGame = $sightWardsBoughtInGame; + + return $this; + } + + /** + * @param double $totalDamageDealtToChampions + * + * @return $this + */ + public function setTotalDamageDealtToChampions($totalDamageDealtToChampions) + { + $this->totalDamageDealtToChampions = $totalDamageDealtToChampions; + + return $this; + } + + /** + * @param int $totalUnitsHealed + * + * @return $this + */ + public function setTotalUnitsHealed($totalUnitsHealed) + { + $this->totalUnitsHealed = $totalUnitsHealed; + + return $this; + } + + /** + * @param int $inhibitorKills + * + * @return $this + */ + public function setInhibitorKills($inhibitorKills) + { + $this->inhibitorKills = $inhibitorKills; + + return $this; + } + + /** + * @param int $totalScoreRank + * + * @return $this + */ + public function setTotalScoreRank($totalScoreRank) + { + $this->totalScoreRank = $totalScoreRank; + + return $this; + } + + /** + * @param double $totalDamageTaken + * + * @return $this + */ + public function setTotalDamageTaken($totalDamageTaken) + { + $this->totalDamageTaken = $totalDamageTaken; + + return $this; + } + + /** + * @param int $killingSprees + * + * @return $this + */ + public function setKillingSprees($killingSprees) + { + $this->killingSprees = $killingSprees; + + return $this; + } + + /** + * @param double $timeCCingOthers + * + * @return $this + */ + public function setTimeCCingOthers($timeCCingOthers) + { + $this->timeCCingOthers = $timeCCingOthers; + + return $this; + } + + /** + * @param double $physicalDamageTaken + * + * @return $this + */ + public function setPhysicalDamageTaken($physicalDamageTaken) + { + $this->physicalDamageTaken = $physicalDamageTaken; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/ParticipantTimelineDto.php b/src/LeagueWrap/Api/Dto/ParticipantTimelineDto.php new file mode 100644 index 0000000..e416445 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/ParticipantTimelineDto.php @@ -0,0 +1,244 @@ +lane; + } + + /** + * @return int + */ + public function getParticipantId() + { + return $this->participantId; + } + + /** + * @return double[] + */ + public function getCsDiffPerMinDeltas() + { + return $this->csDiffPerMinDeltas; + } + + /** + * @return double[] + */ + public function getGoldPerMinDeltas() + { + return $this->goldPerMinDeltas; + } + + /** + * @return double[] + */ + public function getXpDiffPerMinDeltas() + { + return $this->xpDiffPerMinDeltas; + } + + /** + * @return double[] + */ + public function getCreepsPerMinDeltas() + { + return $this->creepsPerMinDeltas; + } + + /** + * @return double[] + */ + public function getXpPerMinDeltas() + { + return $this->xpPerMinDeltas; + } + + /** + * @return string + */ + public function getRole() + { + return $this->role; + } + + /** + * @return double[] + */ + public function getDamageTakenDiffPerMinDeltas() + { + return $this->damageTakenDiffPerMinDeltas; + } + + /** + * @return double[] + */ + public function getDamageTakenPerMinDeltas() + { + return $this->damageTakenPerMinDeltas; + } + + /** + * @param string $lane + * + * @return $this + */ + public function setLane($lane) + { + $this->lane = $lane; + + return $this; + } + + /** + * @param int $participantId + * + * @return $this + */ + public function setParticipantId($participantId) + { + $this->participantId = $participantId; + + return $this; + } + + /** + * @param double[] $csDiffPerMinDeltas Map[string, double] + * + * @return $this + */ + public function setCsDiffPerMinDeltas($csDiffPerMinDeltas) + { + $this->csDiffPerMinDeltas = $csDiffPerMinDeltas; + + return $this; + } + + /** + * @param double[] $goldPerMinDeltas Map[string, double] + * + * @return $this + */ + public function setGoldPerMinDeltas($goldPerMinDeltas) + { + $this->goldPerMinDeltas = $goldPerMinDeltas; + + return $this; + } + + /** + * @param double[] $xpDiffPerMinDeltas Map[string, double] + * + * @return $this + */ + public function setXpDiffPerMinDeltas($xpDiffPerMinDeltas) + { + $this->xpDiffPerMinDeltas = $xpDiffPerMinDeltas; + + return $this; + } + + /** + * @param double[] $creepsPerMinDeltas Map[string, double] + * + * @return $this + */ + public function setCreepsPerMinDeltas($creepsPerMinDeltas) + { + $this->creepsPerMinDeltas = $creepsPerMinDeltas; + + return $this; + } + + /** + * @param double[] $xpPerMinDeltas Map[string, double] + * + * @return $this + */ + public function setXpPerMinDeltas($xpPerMinDeltas) + { + $this->xpPerMinDeltas = $xpPerMinDeltas; + + return $this; + } + + /** + * @param string $role + * + * @return $this + */ + public function setRole($role) + { + $this->role = $role; + + return $this; + } + + /** + * @param double[] $damageTakenDiffPerMinDeltas Map[string, double] + * + * @return $this + */ + public function setDamageTakenDiffPerMinDeltas($damageTakenDiffPerMinDeltas) + { + $this->damageTakenDiffPerMinDeltas = $damageTakenDiffPerMinDeltas; + + return $this; + } + + /** + * @param double[] $damageTakenPerMinDeltas Map[string, double] + * + * @return $this + */ + public function setDamageTakenPerMinDeltas($damageTakenPerMinDeltas) + { + $this->damageTakenPerMinDeltas = $damageTakenPerMinDeltas; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/PassiveDto.php b/src/LeagueWrap/Api/Dto/PassiveDto.php new file mode 100644 index 0000000..404c2cf --- /dev/null +++ b/src/LeagueWrap/Api/Dto/PassiveDto.php @@ -0,0 +1,106 @@ +image; + } + + /** + * @return string + */ + public function getSanitizedDescription() + { + return $this->sanitizedDescription; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * @param ImageDto $image + * + * @return $this + */ + public function setImage($image) + { + $this->image = new ImageDto($image); + + return $this; + } + + /** + * @param string $sanitizedDescription + * + * @return $this + */ + public function setSanitizedDescription($sanitizedDescription) + { + $this->sanitizedDescription = $sanitizedDescription; + + return $this; + } + + /** + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * @param string $description + * + * @return $this + */ + public function setDescription($description) + { + $this->description = $description; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/PlayerDto.php b/src/LeagueWrap/Api/Dto/PlayerDto.php new file mode 100644 index 0000000..a9e4d55 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/PlayerDto.php @@ -0,0 +1,198 @@ +currentPlatformId; + } + + /** + * @return string + */ + public function getSummonerName() + { + return $this->summonerName; + } + + /** + * @return string + */ + public function getMatchHistoryUri() + { + return $this->matchHistoryUri; + } + + /** + * @return string + */ + public function getPlatformId() + { + return $this->platformId; + } + + /** + * @return double + */ + public function getCurrentAccountId() + { + return $this->currentAccountId; + } + + /** + * @return int + */ + public function getProfileIcon() + { + return $this->profileIcon; + } + + /** + * @return double + */ + public function getSummonerId() + { + return $this->summonerId; + } + + /** + * @return double + */ + public function getAccountId() + { + return $this->accountId; + } + + /** + * @param string $currentPlatformId + * + * @return $this + */ + public function setCurrentPlatformId($currentPlatformId) + { + $this->currentPlatformId = $currentPlatformId; + + return $this; + } + + /** + * @param string $summonerName + * + * @return $this + */ + public function setSummonerName($summonerName) + { + $this->summonerName = $summonerName; + + return $this; + } + + /** + * @param string $matchHistoryUri + * + * @return $this + */ + public function setMatchHistoryUri($matchHistoryUri) + { + $this->matchHistoryUri = $matchHistoryUri; + + return $this; + } + + /** + * @param string $platformId + * + * @return $this + */ + public function setPlatformId($platformId) + { + $this->platformId = $platformId; + + return $this; + } + + /** + * @param double $currentAccountId + * + * @return $this + */ + public function setCurrentAccountId($currentAccountId) + { + $this->currentAccountId = $currentAccountId; + + return $this; + } + + /** + * @param int $profileIcon + * + * @return $this + */ + public function setProfileIcon($profileIcon) + { + $this->profileIcon = $profileIcon; + + return $this; + } + + /** + * @param double $summonerId + * + * @return $this + */ + public function setSummonerId($summonerId) + { + $this->summonerId = $summonerId; + + return $this; + } + + /** + * @param double $accountId + * + * @return $this + */ + public function setAccountId($accountId) + { + $this->accountId = $accountId; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/ProfileIconDataDto.php b/src/LeagueWrap/Api/Dto/ProfileIconDataDto.php new file mode 100644 index 0000000..8e30a8f --- /dev/null +++ b/src/LeagueWrap/Api/Dto/ProfileIconDataDto.php @@ -0,0 +1,85 @@ +data; + } + + /** + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * @param ProfileIconDetailsDto[] $data Map[string, ProfileIconDetailsDto] + * + * @return $this + */ + public function setData($data) + { + foreach ($data as $key => $dtoData) { + $this->data[$key] = new ProfileIconDetailsDto($dtoData); + } + + return $this; + } + + /** + * @param string $version + * + * @return $this + */ + public function setVersion($version) + { + $this->version = $version; + + return $this; + } + + /** + * @param string $type + * + * @return $this + */ + public function setType($type) + { + $this->type = $type; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/ProfileIconDetailsDto.php b/src/LeagueWrap/Api/Dto/ProfileIconDetailsDto.php new file mode 100644 index 0000000..1df048d --- /dev/null +++ b/src/LeagueWrap/Api/Dto/ProfileIconDetailsDto.php @@ -0,0 +1,60 @@ +image; + } + + /** + * @return double + */ + public function getId() + { + return $this->id; + } + + /** + * @param ImageDto $image + * + * @return $this + */ + public function setImage($image) + { + $this->image = new ImageDto($image); + + return $this; + } + + /** + * @param double $id + * + * @return $this + */ + public function setId($id) + { + $this->id = $id; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/RealmDto.php b/src/LeagueWrap/Api/Dto/RealmDto.php new file mode 100644 index 0000000..0e6692e --- /dev/null +++ b/src/LeagueWrap/Api/Dto/RealmDto.php @@ -0,0 +1,221 @@ +lg; + } + + /** + * @return string + */ + public function getDd() + { + return $this->dd; + } + + /** + * @return string + */ + public function getL() + { + return $this->l; + } + + /** + * @return string[] + */ + public function getN() + { + return $this->n; + } + + /** + * @return int + */ + public function getProfileiconmax() + { + return $this->profileiconmax; + } + + /** + * @return string + */ + public function getStore() + { + return $this->store; + } + + /** + * @return string + */ + public function getV() + { + return $this->v; + } + + /** + * @return string + */ + public function getCdn() + { + return $this->cdn; + } + + /** + * @return string + */ + public function getCss() + { + return $this->css; + } + + /** + * @param string $lg + * + * @return $this + */ + public function setLg($lg) + { + $this->lg = $lg; + + return $this; + } + + /** + * @param string $dd + * + * @return $this + */ + public function setDd($dd) + { + $this->dd = $dd; + + return $this; + } + + /** + * @param string $l + * + * @return $this + */ + public function setL($l) + { + $this->l = $l; + + return $this; + } + + /** + * @param string[] $n Map[string, string] + * + * @return $this + */ + public function setN($n) + { + $this->n = $n; + + return $this; + } + + /** + * @param int $profileiconmax + * + * @return $this + */ + public function setProfileiconmax($profileiconmax) + { + $this->profileiconmax = $profileiconmax; + + return $this; + } + + /** + * @param string $store + * + * @return $this + */ + public function setStore($store) + { + $this->store = $store; + + return $this; + } + + /** + * @param string $v + * + * @return $this + */ + public function setV($v) + { + $this->v = $v; + + return $this; + } + + /** + * @param string $cdn + * + * @return $this + */ + public function setCdn($cdn) + { + $this->cdn = $cdn; + + return $this; + } + + /** + * @param string $css + * + * @return $this + */ + public function setCss($css) + { + $this->css = $css; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/RecommendedDto.php b/src/LeagueWrap/Api/Dto/RecommendedDto.php new file mode 100644 index 0000000..db9d024 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/RecommendedDto.php @@ -0,0 +1,177 @@ +map; + } + + /** + * @return BlockDto[] + */ + public function getBlocks() + { + return $this->blocks; + } + + /** + * @return string + */ + public function getChampion() + { + return $this->champion; + } + + /** + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * @return bool + */ + public function isPriority() + { + return $this->priority; + } + + /** + * @return string + */ + public function getMode() + { + return $this->mode; + } + + /** + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * @param string $map + * + * @return $this + */ + public function setMap($map) + { + $this->map = $map; + + return $this; + } + + /** + * @param BlockDto[] $blocks + * + * @return $this + */ + public function setBlocks($blocks) + { + foreach ($blocks as $key => $dtoData) { + $this->blocks[$key] = new BlockDto($dtoData); + } + + return $this; + } + + /** + * @param string $champion + * + * @return $this + */ + public function setChampion($champion) + { + $this->champion = $champion; + + return $this; + } + + /** + * @param string $title + * + * @return $this + */ + public function setTitle($title) + { + $this->title = $title; + + return $this; + } + + /** + * @param bool $priority + * + * @return $this + */ + public function setPriority($priority) + { + $this->priority = $priority; + + return $this; + } + + /** + * @param string $mode + * + * @return $this + */ + public function setMode($mode) + { + $this->mode = $mode; + + return $this; + } + + /** + * @param string $type + * + * @return $this + */ + public function setType($type) + { + $this->type = $type; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/Rune.php b/src/LeagueWrap/Api/Dto/Rune.php new file mode 100644 index 0000000..d245bbf --- /dev/null +++ b/src/LeagueWrap/Api/Dto/Rune.php @@ -0,0 +1,60 @@ +count; + } + + /** + * @return double + */ + public function getRuneId() + { + return $this->runeId; + } + + /** + * @param int $count + * + * @return $this + */ + public function setCount($count) + { + $this->count = $count; + + return $this; + } + + /** + * @param double $runeId + * + * @return $this + */ + public function setRuneId($runeId) + { + $this->runeId = $runeId; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/RuneDto.php b/src/LeagueWrap/Api/Dto/RuneDto.php new file mode 100644 index 0000000..d022275 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/RuneDto.php @@ -0,0 +1,60 @@ +runeId; + } + + /** + * @return int + */ + public function getRank() + { + return $this->rank; + } + + /** + * @param int $runeId + * + * @return $this + */ + public function setRuneId($runeId) + { + $this->runeId = $runeId; + + return $this; + } + + /** + * @param int $rank + * + * @return $this + */ + public function setRank($rank) + { + $this->rank = $rank; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/RuneListDto.php b/src/LeagueWrap/Api/Dto/RuneListDto.php new file mode 100644 index 0000000..d24c403 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/RuneListDto.php @@ -0,0 +1,85 @@ +data; + } + + /** + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * @param RuneDto[] $data Map[string, RuneDto] + * + * @return $this + */ + public function setData($data) + { + foreach ($data as $key => $dtoData) { + $this->data[$key] = new RuneDto($dtoData); + } + + return $this; + } + + /** + * @param string $version + * + * @return $this + */ + public function setVersion($version) + { + $this->version = $version; + + return $this; + } + + /** + * @param string $type + * + * @return $this + */ + public function setType($type) + { + $this->type = $type; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/RunePageDto.php b/src/LeagueWrap/Api/Dto/RunePageDto.php new file mode 100644 index 0000000..b63bc65 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/RunePageDto.php @@ -0,0 +1,108 @@ +current; + } + + /** + * @return RuneSlotDto[] + */ + public function getSlots() + { + return $this->slots; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @return double + */ + public function getId() + { + return $this->id; + } + + /** + * @param bool $current + * + * @return $this + */ + public function setCurrent($current) + { + $this->current = $current; + + return $this; + } + + /** + * @param RuneSlotDto[] $slots + * + * @return $this + */ + public function setSlots($slots) + { + foreach ($slots as $key => $dtoData) { + $this->slots[$key] = new RuneSlotDto($dtoData); + } + + return $this; + } + + /** + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * @param double $id + * + * @return $this + */ + public function setId($id) + { + $this->id = $id; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/RunePagesDto.php b/src/LeagueWrap/Api/Dto/RunePagesDto.php new file mode 100644 index 0000000..04d9901 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/RunePagesDto.php @@ -0,0 +1,62 @@ +pages; + } + + /** + * @return double + */ + public function getSummonerId() + { + return $this->summonerId; + } + + /** + * @param RunePageDto[] $pages + * + * @return $this + */ + public function setPages($pages) + { + foreach ($pages as $key => $dtoData) { + $this->pages[$key] = new RunePageDto($dtoData); + } + + return $this; + } + + /** + * @param double $summonerId + * + * @return $this + */ + public function setSummonerId($summonerId) + { + $this->summonerId = $summonerId; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/RuneSlotDto.php b/src/LeagueWrap/Api/Dto/RuneSlotDto.php new file mode 100644 index 0000000..0b524c7 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/RuneSlotDto.php @@ -0,0 +1,60 @@ +runeSlotId; + } + + /** + * @return int + */ + public function getRuneId() + { + return $this->runeId; + } + + /** + * @param int $runeSlotId + * + * @return $this + */ + public function setRuneSlotId($runeSlotId) + { + $this->runeSlotId = $runeSlotId; + + return $this; + } + + /** + * @param int $runeId + * + * @return $this + */ + public function setRuneId($runeId) + { + $this->runeId = $runeId; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/RuneStatsDto.php b/src/LeagueWrap/Api/Dto/RuneStatsDto.php new file mode 100644 index 0000000..e93ebb8 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/RuneStatsDto.php @@ -0,0 +1,1509 @@ +PercentTimeDeadModPerLevel; + } + + /** + * @return double + */ + public function getPercentArmorPenetrationModPerLevel() + { + return $this->PercentArmorPenetrationModPerLevel; + } + + /** + * @return double + */ + public function getPercentCritDamageMod() + { + return $this->PercentCritDamageMod; + } + + /** + * @return double + */ + public function getPercentSpellBlockMod() + { + return $this->PercentSpellBlockMod; + } + + /** + * @return double + */ + public function getPercentHPRegenMod() + { + return $this->PercentHPRegenMod; + } + + /** + * @return double + */ + public function getPercentMovementSpeedMod() + { + return $this->PercentMovementSpeedMod; + } + + /** + * @return double + */ + public function getFlatSpellBlockMod() + { + return $this->FlatSpellBlockMod; + } + + /** + * @return double + */ + public function getFlatEnergyRegenModPerLevel() + { + return $this->FlatEnergyRegenModPerLevel; + } + + /** + * @return double + */ + public function getFlatEnergyPoolMod() + { + return $this->FlatEnergyPoolMod; + } + + /** + * @return double + */ + public function getFlatMagicPenetrationModPerLevel() + { + return $this->FlatMagicPenetrationModPerLevel; + } + + /** + * @return double + */ + public function getPercentLifeStealMod() + { + return $this->PercentLifeStealMod; + } + + /** + * @return double + */ + public function getFlatMPPoolMod() + { + return $this->FlatMPPoolMod; + } + + /** + * @return double + */ + public function getPercentCooldownMod() + { + return $this->PercentCooldownMod; + } + + /** + * @return double + */ + public function getPercentMagicPenetrationMod() + { + return $this->PercentMagicPenetrationMod; + } + + /** + * @return double + */ + public function getFlatArmorPenetrationModPerLevel() + { + return $this->FlatArmorPenetrationModPerLevel; + } + + /** + * @return double + */ + public function getFlatMovementSpeedMod() + { + return $this->FlatMovementSpeedMod; + } + + /** + * @return double + */ + public function getFlatTimeDeadModPerLevel() + { + return $this->FlatTimeDeadModPerLevel; + } + + /** + * @return double + */ + public function getFlatArmorModPerLevel() + { + return $this->FlatArmorModPerLevel; + } + + /** + * @return double + */ + public function getPercentAttackSpeedMod() + { + return $this->PercentAttackSpeedMod; + } + + /** + * @return double + */ + public function getFlatDodgeModPerLevel() + { + return $this->FlatDodgeModPerLevel; + } + + /** + * @return double + */ + public function getPercentMagicDamageMod() + { + return $this->PercentMagicDamageMod; + } + + /** + * @return double + */ + public function getPercentBlockMod() + { + return $this->PercentBlockMod; + } + + /** + * @return double + */ + public function getFlatDodgeMod() + { + return $this->FlatDodgeMod; + } + + /** + * @return double + */ + public function getFlatEnergyRegenMod() + { + return $this->FlatEnergyRegenMod; + } + + /** + * @return double + */ + public function getFlatHPModPerLevel() + { + return $this->FlatHPModPerLevel; + } + + /** + * @return double + */ + public function getPercentAttackSpeedModPerLevel() + { + return $this->PercentAttackSpeedModPerLevel; + } + + /** + * @return double + */ + public function getPercentSpellVampMod() + { + return $this->PercentSpellVampMod; + } + + /** + * @return double + */ + public function getFlatMPRegenMod() + { + return $this->FlatMPRegenMod; + } + + /** + * @return double + */ + public function getPercentHPPoolMod() + { + return $this->PercentHPPoolMod; + } + + /** + * @return double + */ + public function getPercentDodgeMod() + { + return $this->PercentDodgeMod; + } + + /** + * @return double + */ + public function getFlatAttackSpeedMod() + { + return $this->FlatAttackSpeedMod; + } + + /** + * @return double + */ + public function getFlatArmorMod() + { + return $this->FlatArmorMod; + } + + /** + * @return double + */ + public function getFlatMagicDamageModPerLevel() + { + return $this->FlatMagicDamageModPerLevel; + } + + /** + * @return double + */ + public function getFlatHPRegenMod() + { + return $this->FlatHPRegenMod; + } + + /** + * @return double + */ + public function getPercentPhysicalDamageMod() + { + return $this->PercentPhysicalDamageMod; + } + + /** + * @return double + */ + public function getFlatCritChanceModPerLevel() + { + return $this->FlatCritChanceModPerLevel; + } + + /** + * @return double + */ + public function getFlatSpellBlockModPerLevel() + { + return $this->FlatSpellBlockModPerLevel; + } + + /** + * @return double + */ + public function getPercentTimeDeadMod() + { + return $this->PercentTimeDeadMod; + } + + /** + * @return double + */ + public function getFlatBlockMod() + { + return $this->FlatBlockMod; + } + + /** + * @return double + */ + public function getPercentMPPoolMod() + { + return $this->PercentMPPoolMod; + } + + /** + * @return double + */ + public function getFlatMagicDamageMod() + { + return $this->FlatMagicDamageMod; + } + + /** + * @return double + */ + public function getPercentMPRegenMod() + { + return $this->PercentMPRegenMod; + } + + /** + * @return double + */ + public function getPercentMovementSpeedModPerLevel() + { + return $this->PercentMovementSpeedModPerLevel; + } + + /** + * @return double + */ + public function getPercentCooldownModPerLevel() + { + return $this->PercentCooldownModPerLevel; + } + + /** + * @return double + */ + public function getFlatMPModPerLevel() + { + return $this->FlatMPModPerLevel; + } + + /** + * @return double + */ + public function getFlatEnergyModPerLevel() + { + return $this->FlatEnergyModPerLevel; + } + + /** + * @return double + */ + public function getFlatPhysicalDamageMod() + { + return $this->FlatPhysicalDamageMod; + } + + /** + * @return double + */ + public function getFlatHPRegenModPerLevel() + { + return $this->FlatHPRegenModPerLevel; + } + + /** + * @return double + */ + public function getFlatCritDamageMod() + { + return $this->FlatCritDamageMod; + } + + /** + * @return double + */ + public function getPercentArmorMod() + { + return $this->PercentArmorMod; + } + + /** + * @return double + */ + public function getFlatMagicPenetrationMod() + { + return $this->FlatMagicPenetrationMod; + } + + /** + * @return double + */ + public function getPercentCritChanceMod() + { + return $this->PercentCritChanceMod; + } + + /** + * @return double + */ + public function getFlatPhysicalDamageModPerLevel() + { + return $this->FlatPhysicalDamageModPerLevel; + } + + /** + * @return double + */ + public function getPercentArmorPenetrationMod() + { + return $this->PercentArmorPenetrationMod; + } + + /** + * @return double + */ + public function getPercentEXPBonus() + { + return $this->PercentEXPBonus; + } + + /** + * @return double + */ + public function getFlatMPRegenModPerLevel() + { + return $this->FlatMPRegenModPerLevel; + } + + /** + * @return double + */ + public function getPercentMagicPenetrationModPerLevel() + { + return $this->PercentMagicPenetrationModPerLevel; + } + + /** + * @return double + */ + public function getFlatTimeDeadMod() + { + return $this->FlatTimeDeadMod; + } + + /** + * @return double + */ + public function getFlatMovementSpeedModPerLevel() + { + return $this->FlatMovementSpeedModPerLevel; + } + + /** + * @return double + */ + public function getFlatGoldPer10Mod() + { + return $this->FlatGoldPer10Mod; + } + + /** + * @return double + */ + public function getFlatArmorPenetrationMod() + { + return $this->FlatArmorPenetrationMod; + } + + /** + * @return double + */ + public function getFlatCritDamageModPerLevel() + { + return $this->FlatCritDamageModPerLevel; + } + + /** + * @return double + */ + public function getFlatHPPoolMod() + { + return $this->FlatHPPoolMod; + } + + /** + * @return double + */ + public function getFlatCritChanceMod() + { + return $this->FlatCritChanceMod; + } + + /** + * @return double + */ + public function getFlatEXPBonus() + { + return $this->FlatEXPBonus; + } + + /** + * @param double $PercentTimeDeadModPerLevel + * + * @return $this + */ + public function setPercentTimeDeadModPerLevel($PercentTimeDeadModPerLevel) + { + $this->PercentTimeDeadModPerLevel = $PercentTimeDeadModPerLevel; + + return $this; + } + + /** + * @param double $PercentArmorPenetrationModPerLevel + * + * @return $this + */ + public function setPercentArmorPenetrationModPerLevel($PercentArmorPenetrationModPerLevel) + { + $this->PercentArmorPenetrationModPerLevel = $PercentArmorPenetrationModPerLevel; + + return $this; + } + + /** + * @param double $PercentCritDamageMod + * + * @return $this + */ + public function setPercentCritDamageMod($PercentCritDamageMod) + { + $this->PercentCritDamageMod = $PercentCritDamageMod; + + return $this; + } + + /** + * @param double $PercentSpellBlockMod + * + * @return $this + */ + public function setPercentSpellBlockMod($PercentSpellBlockMod) + { + $this->PercentSpellBlockMod = $PercentSpellBlockMod; + + return $this; + } + + /** + * @param double $PercentHPRegenMod + * + * @return $this + */ + public function setPercentHPRegenMod($PercentHPRegenMod) + { + $this->PercentHPRegenMod = $PercentHPRegenMod; + + return $this; + } + + /** + * @param double $PercentMovementSpeedMod + * + * @return $this + */ + public function setPercentMovementSpeedMod($PercentMovementSpeedMod) + { + $this->PercentMovementSpeedMod = $PercentMovementSpeedMod; + + return $this; + } + + /** + * @param double $FlatSpellBlockMod + * + * @return $this + */ + public function setFlatSpellBlockMod($FlatSpellBlockMod) + { + $this->FlatSpellBlockMod = $FlatSpellBlockMod; + + return $this; + } + + /** + * @param double $FlatEnergyRegenModPerLevel + * + * @return $this + */ + public function setFlatEnergyRegenModPerLevel($FlatEnergyRegenModPerLevel) + { + $this->FlatEnergyRegenModPerLevel = $FlatEnergyRegenModPerLevel; + + return $this; + } + + /** + * @param double $FlatEnergyPoolMod + * + * @return $this + */ + public function setFlatEnergyPoolMod($FlatEnergyPoolMod) + { + $this->FlatEnergyPoolMod = $FlatEnergyPoolMod; + + return $this; + } + + /** + * @param double $FlatMagicPenetrationModPerLevel + * + * @return $this + */ + public function setFlatMagicPenetrationModPerLevel($FlatMagicPenetrationModPerLevel) + { + $this->FlatMagicPenetrationModPerLevel = $FlatMagicPenetrationModPerLevel; + + return $this; + } + + /** + * @param double $PercentLifeStealMod + * + * @return $this + */ + public function setPercentLifeStealMod($PercentLifeStealMod) + { + $this->PercentLifeStealMod = $PercentLifeStealMod; + + return $this; + } + + /** + * @param double $FlatMPPoolMod + * + * @return $this + */ + public function setFlatMPPoolMod($FlatMPPoolMod) + { + $this->FlatMPPoolMod = $FlatMPPoolMod; + + return $this; + } + + /** + * @param double $PercentCooldownMod + * + * @return $this + */ + public function setPercentCooldownMod($PercentCooldownMod) + { + $this->PercentCooldownMod = $PercentCooldownMod; + + return $this; + } + + /** + * @param double $PercentMagicPenetrationMod + * + * @return $this + */ + public function setPercentMagicPenetrationMod($PercentMagicPenetrationMod) + { + $this->PercentMagicPenetrationMod = $PercentMagicPenetrationMod; + + return $this; + } + + /** + * @param double $FlatArmorPenetrationModPerLevel + * + * @return $this + */ + public function setFlatArmorPenetrationModPerLevel($FlatArmorPenetrationModPerLevel) + { + $this->FlatArmorPenetrationModPerLevel = $FlatArmorPenetrationModPerLevel; + + return $this; + } + + /** + * @param double $FlatMovementSpeedMod + * + * @return $this + */ + public function setFlatMovementSpeedMod($FlatMovementSpeedMod) + { + $this->FlatMovementSpeedMod = $FlatMovementSpeedMod; + + return $this; + } + + /** + * @param double $FlatTimeDeadModPerLevel + * + * @return $this + */ + public function setFlatTimeDeadModPerLevel($FlatTimeDeadModPerLevel) + { + $this->FlatTimeDeadModPerLevel = $FlatTimeDeadModPerLevel; + + return $this; + } + + /** + * @param double $FlatArmorModPerLevel + * + * @return $this + */ + public function setFlatArmorModPerLevel($FlatArmorModPerLevel) + { + $this->FlatArmorModPerLevel = $FlatArmorModPerLevel; + + return $this; + } + + /** + * @param double $PercentAttackSpeedMod + * + * @return $this + */ + public function setPercentAttackSpeedMod($PercentAttackSpeedMod) + { + $this->PercentAttackSpeedMod = $PercentAttackSpeedMod; + + return $this; + } + + /** + * @param double $FlatDodgeModPerLevel + * + * @return $this + */ + public function setFlatDodgeModPerLevel($FlatDodgeModPerLevel) + { + $this->FlatDodgeModPerLevel = $FlatDodgeModPerLevel; + + return $this; + } + + /** + * @param double $PercentMagicDamageMod + * + * @return $this + */ + public function setPercentMagicDamageMod($PercentMagicDamageMod) + { + $this->PercentMagicDamageMod = $PercentMagicDamageMod; + + return $this; + } + + /** + * @param double $PercentBlockMod + * + * @return $this + */ + public function setPercentBlockMod($PercentBlockMod) + { + $this->PercentBlockMod = $PercentBlockMod; + + return $this; + } + + /** + * @param double $FlatDodgeMod + * + * @return $this + */ + public function setFlatDodgeMod($FlatDodgeMod) + { + $this->FlatDodgeMod = $FlatDodgeMod; + + return $this; + } + + /** + * @param double $FlatEnergyRegenMod + * + * @return $this + */ + public function setFlatEnergyRegenMod($FlatEnergyRegenMod) + { + $this->FlatEnergyRegenMod = $FlatEnergyRegenMod; + + return $this; + } + + /** + * @param double $FlatHPModPerLevel + * + * @return $this + */ + public function setFlatHPModPerLevel($FlatHPModPerLevel) + { + $this->FlatHPModPerLevel = $FlatHPModPerLevel; + + return $this; + } + + /** + * @param double $PercentAttackSpeedModPerLevel + * + * @return $this + */ + public function setPercentAttackSpeedModPerLevel($PercentAttackSpeedModPerLevel) + { + $this->PercentAttackSpeedModPerLevel = $PercentAttackSpeedModPerLevel; + + return $this; + } + + /** + * @param double $PercentSpellVampMod + * + * @return $this + */ + public function setPercentSpellVampMod($PercentSpellVampMod) + { + $this->PercentSpellVampMod = $PercentSpellVampMod; + + return $this; + } + + /** + * @param double $FlatMPRegenMod + * + * @return $this + */ + public function setFlatMPRegenMod($FlatMPRegenMod) + { + $this->FlatMPRegenMod = $FlatMPRegenMod; + + return $this; + } + + /** + * @param double $PercentHPPoolMod + * + * @return $this + */ + public function setPercentHPPoolMod($PercentHPPoolMod) + { + $this->PercentHPPoolMod = $PercentHPPoolMod; + + return $this; + } + + /** + * @param double $PercentDodgeMod + * + * @return $this + */ + public function setPercentDodgeMod($PercentDodgeMod) + { + $this->PercentDodgeMod = $PercentDodgeMod; + + return $this; + } + + /** + * @param double $FlatAttackSpeedMod + * + * @return $this + */ + public function setFlatAttackSpeedMod($FlatAttackSpeedMod) + { + $this->FlatAttackSpeedMod = $FlatAttackSpeedMod; + + return $this; + } + + /** + * @param double $FlatArmorMod + * + * @return $this + */ + public function setFlatArmorMod($FlatArmorMod) + { + $this->FlatArmorMod = $FlatArmorMod; + + return $this; + } + + /** + * @param double $FlatMagicDamageModPerLevel + * + * @return $this + */ + public function setFlatMagicDamageModPerLevel($FlatMagicDamageModPerLevel) + { + $this->FlatMagicDamageModPerLevel = $FlatMagicDamageModPerLevel; + + return $this; + } + + /** + * @param double $FlatHPRegenMod + * + * @return $this + */ + public function setFlatHPRegenMod($FlatHPRegenMod) + { + $this->FlatHPRegenMod = $FlatHPRegenMod; + + return $this; + } + + /** + * @param double $PercentPhysicalDamageMod + * + * @return $this + */ + public function setPercentPhysicalDamageMod($PercentPhysicalDamageMod) + { + $this->PercentPhysicalDamageMod = $PercentPhysicalDamageMod; + + return $this; + } + + /** + * @param double $FlatCritChanceModPerLevel + * + * @return $this + */ + public function setFlatCritChanceModPerLevel($FlatCritChanceModPerLevel) + { + $this->FlatCritChanceModPerLevel = $FlatCritChanceModPerLevel; + + return $this; + } + + /** + * @param double $FlatSpellBlockModPerLevel + * + * @return $this + */ + public function setFlatSpellBlockModPerLevel($FlatSpellBlockModPerLevel) + { + $this->FlatSpellBlockModPerLevel = $FlatSpellBlockModPerLevel; + + return $this; + } + + /** + * @param double $PercentTimeDeadMod + * + * @return $this + */ + public function setPercentTimeDeadMod($PercentTimeDeadMod) + { + $this->PercentTimeDeadMod = $PercentTimeDeadMod; + + return $this; + } + + /** + * @param double $FlatBlockMod + * + * @return $this + */ + public function setFlatBlockMod($FlatBlockMod) + { + $this->FlatBlockMod = $FlatBlockMod; + + return $this; + } + + /** + * @param double $PercentMPPoolMod + * + * @return $this + */ + public function setPercentMPPoolMod($PercentMPPoolMod) + { + $this->PercentMPPoolMod = $PercentMPPoolMod; + + return $this; + } + + /** + * @param double $FlatMagicDamageMod + * + * @return $this + */ + public function setFlatMagicDamageMod($FlatMagicDamageMod) + { + $this->FlatMagicDamageMod = $FlatMagicDamageMod; + + return $this; + } + + /** + * @param double $PercentMPRegenMod + * + * @return $this + */ + public function setPercentMPRegenMod($PercentMPRegenMod) + { + $this->PercentMPRegenMod = $PercentMPRegenMod; + + return $this; + } + + /** + * @param double $PercentMovementSpeedModPerLevel + * + * @return $this + */ + public function setPercentMovementSpeedModPerLevel($PercentMovementSpeedModPerLevel) + { + $this->PercentMovementSpeedModPerLevel = $PercentMovementSpeedModPerLevel; + + return $this; + } + + /** + * @param double $PercentCooldownModPerLevel + * + * @return $this + */ + public function setPercentCooldownModPerLevel($PercentCooldownModPerLevel) + { + $this->PercentCooldownModPerLevel = $PercentCooldownModPerLevel; + + return $this; + } + + /** + * @param double $FlatMPModPerLevel + * + * @return $this + */ + public function setFlatMPModPerLevel($FlatMPModPerLevel) + { + $this->FlatMPModPerLevel = $FlatMPModPerLevel; + + return $this; + } + + /** + * @param double $FlatEnergyModPerLevel + * + * @return $this + */ + public function setFlatEnergyModPerLevel($FlatEnergyModPerLevel) + { + $this->FlatEnergyModPerLevel = $FlatEnergyModPerLevel; + + return $this; + } + + /** + * @param double $FlatPhysicalDamageMod + * + * @return $this + */ + public function setFlatPhysicalDamageMod($FlatPhysicalDamageMod) + { + $this->FlatPhysicalDamageMod = $FlatPhysicalDamageMod; + + return $this; + } + + /** + * @param double $FlatHPRegenModPerLevel + * + * @return $this + */ + public function setFlatHPRegenModPerLevel($FlatHPRegenModPerLevel) + { + $this->FlatHPRegenModPerLevel = $FlatHPRegenModPerLevel; + + return $this; + } + + /** + * @param double $FlatCritDamageMod + * + * @return $this + */ + public function setFlatCritDamageMod($FlatCritDamageMod) + { + $this->FlatCritDamageMod = $FlatCritDamageMod; + + return $this; + } + + /** + * @param double $PercentArmorMod + * + * @return $this + */ + public function setPercentArmorMod($PercentArmorMod) + { + $this->PercentArmorMod = $PercentArmorMod; + + return $this; + } + + /** + * @param double $FlatMagicPenetrationMod + * + * @return $this + */ + public function setFlatMagicPenetrationMod($FlatMagicPenetrationMod) + { + $this->FlatMagicPenetrationMod = $FlatMagicPenetrationMod; + + return $this; + } + + /** + * @param double $PercentCritChanceMod + * + * @return $this + */ + public function setPercentCritChanceMod($PercentCritChanceMod) + { + $this->PercentCritChanceMod = $PercentCritChanceMod; + + return $this; + } + + /** + * @param double $FlatPhysicalDamageModPerLevel + * + * @return $this + */ + public function setFlatPhysicalDamageModPerLevel($FlatPhysicalDamageModPerLevel) + { + $this->FlatPhysicalDamageModPerLevel = $FlatPhysicalDamageModPerLevel; + + return $this; + } + + /** + * @param double $PercentArmorPenetrationMod + * + * @return $this + */ + public function setPercentArmorPenetrationMod($PercentArmorPenetrationMod) + { + $this->PercentArmorPenetrationMod = $PercentArmorPenetrationMod; + + return $this; + } + + /** + * @param double $PercentEXPBonus + * + * @return $this + */ + public function setPercentEXPBonus($PercentEXPBonus) + { + $this->PercentEXPBonus = $PercentEXPBonus; + + return $this; + } + + /** + * @param double $FlatMPRegenModPerLevel + * + * @return $this + */ + public function setFlatMPRegenModPerLevel($FlatMPRegenModPerLevel) + { + $this->FlatMPRegenModPerLevel = $FlatMPRegenModPerLevel; + + return $this; + } + + /** + * @param double $PercentMagicPenetrationModPerLevel + * + * @return $this + */ + public function setPercentMagicPenetrationModPerLevel($PercentMagicPenetrationModPerLevel) + { + $this->PercentMagicPenetrationModPerLevel = $PercentMagicPenetrationModPerLevel; + + return $this; + } + + /** + * @param double $FlatTimeDeadMod + * + * @return $this + */ + public function setFlatTimeDeadMod($FlatTimeDeadMod) + { + $this->FlatTimeDeadMod = $FlatTimeDeadMod; + + return $this; + } + + /** + * @param double $FlatMovementSpeedModPerLevel + * + * @return $this + */ + public function setFlatMovementSpeedModPerLevel($FlatMovementSpeedModPerLevel) + { + $this->FlatMovementSpeedModPerLevel = $FlatMovementSpeedModPerLevel; + + return $this; + } + + /** + * @param double $FlatGoldPer10Mod + * + * @return $this + */ + public function setFlatGoldPer10Mod($FlatGoldPer10Mod) + { + $this->FlatGoldPer10Mod = $FlatGoldPer10Mod; + + return $this; + } + + /** + * @param double $FlatArmorPenetrationMod + * + * @return $this + */ + public function setFlatArmorPenetrationMod($FlatArmorPenetrationMod) + { + $this->FlatArmorPenetrationMod = $FlatArmorPenetrationMod; + + return $this; + } + + /** + * @param double $FlatCritDamageModPerLevel + * + * @return $this + */ + public function setFlatCritDamageModPerLevel($FlatCritDamageModPerLevel) + { + $this->FlatCritDamageModPerLevel = $FlatCritDamageModPerLevel; + + return $this; + } + + /** + * @param double $FlatHPPoolMod + * + * @return $this + */ + public function setFlatHPPoolMod($FlatHPPoolMod) + { + $this->FlatHPPoolMod = $FlatHPPoolMod; + + return $this; + } + + /** + * @param double $FlatCritChanceMod + * + * @return $this + */ + public function setFlatCritChanceMod($FlatCritChanceMod) + { + $this->FlatCritChanceMod = $FlatCritChanceMod; + + return $this; + } + + /** + * @param double $FlatEXPBonus + * + * @return $this + */ + public function setFlatEXPBonus($FlatEXPBonus) + { + $this->FlatEXPBonus = $FlatEXPBonus; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/Service.php b/src/LeagueWrap/Api/Dto/Service.php new file mode 100644 index 0000000..09fe14d --- /dev/null +++ b/src/LeagueWrap/Api/Dto/Service.php @@ -0,0 +1,106 @@ +status; + } + + /** + * @return Incident[] + */ + public function getIncidents() + { + return $this->incidents; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @return string + */ + public function getSlug() + { + return $this->slug; + } + + /** + * @param string $status + * + * @return $this + */ + public function setStatus($status) + { + $this->status = $status; + + return $this; + } + + /** + * @param Incident[] $incidents + * + * @return $this + */ + public function setIncidents($incidents) + { + $this->incidents = $incidents; + + return $this; + } + + /** + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * @param string $slug + * + * @return $this + */ + public function setSlug($slug) + { + $this->slug = $slug; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/ShardStatus.php b/src/LeagueWrap/Api/Dto/ShardStatus.php new file mode 100644 index 0000000..e01c512 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/ShardStatus.php @@ -0,0 +1,152 @@ +name; + } + + /** + * @return string + */ + public function getRegion_tag() + { + return $this->region_tag; + } + + /** + * @return string + */ + public function getHostname() + { + return $this->hostname; + } + + /** + * @return Service[] + */ + public function getServices() + { + return $this->services; + } + + /** + * @return string + */ + public function getSlug() + { + return $this->slug; + } + + /** + * @return string[] + */ + public function getLocales() + { + return $this->locales; + } + + /** + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * @param string $region_tag + * + * @return $this + */ + public function setRegion_tag($region_tag) + { + $this->region_tag = $region_tag; + + return $this; + } + + /** + * @param string $hostname + * + * @return $this + */ + public function setHostname($hostname) + { + $this->hostname = $hostname; + + return $this; + } + + /** + * @param Service[] $services + * + * @return $this + */ + public function setServices($services) + { + $this->services = $services; + + return $this; + } + + /** + * @param string $slug + * + * @return $this + */ + public function setSlug($slug) + { + $this->slug = $slug; + + return $this; + } + + /** + * @param string[] $locales + * + * @return $this + */ + public function setLocales($locales) + { + $this->locales = $locales; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/SkinDto.php b/src/LeagueWrap/Api/Dto/SkinDto.php new file mode 100644 index 0000000..53673e2 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/SkinDto.php @@ -0,0 +1,83 @@ +num; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @param int $num + * + * @return $this + */ + public function setNum($num) + { + $this->num = $num; + + return $this; + } + + /** + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * @param int $id + * + * @return $this + */ + public function setId($id) + { + $this->id = $id; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/SpellVarsDto.php b/src/LeagueWrap/Api/Dto/SpellVarsDto.php new file mode 100644 index 0000000..ab9f696 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/SpellVarsDto.php @@ -0,0 +1,129 @@ +ranksWith; + } + + /** + * @return string + */ + public function getDyn() + { + return $this->dyn; + } + + /** + * @return string + */ + public function getLink() + { + return $this->link; + } + + /** + * @return double[] + */ + public function getCoeff() + { + return $this->coeff; + } + + /** + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * @param string $ranksWith + * + * @return $this + */ + public function setRanksWith($ranksWith) + { + $this->ranksWith = $ranksWith; + + return $this; + } + + /** + * @param string $dyn + * + * @return $this + */ + public function setDyn($dyn) + { + $this->dyn = $dyn; + + return $this; + } + + /** + * @param string $link + * + * @return $this + */ + public function setLink($link) + { + $this->link = $link; + + return $this; + } + + /** + * @param double[] $coeff + * + * @return $this + */ + public function setCoeff($coeff) + { + $this->coeff = $coeff; + + return $this; + } + + /** + * @param string $key + * + * @return $this + */ + public function setKey($key) + { + $this->key = $key; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/StatsDto.php b/src/LeagueWrap/Api/Dto/StatsDto.php new file mode 100644 index 0000000..de7cc38 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/StatsDto.php @@ -0,0 +1,474 @@ +armorperlevel; + } + + /** + * @return double + */ + public function getHpperlevel() + { + return $this->hpperlevel; + } + + /** + * @return double + */ + public function getAttackdamage() + { + return $this->attackdamage; + } + + /** + * @return double + */ + public function getMpperlevel() + { + return $this->mpperlevel; + } + + /** + * @return double + */ + public function getAttackspeedoffset() + { + return $this->attackspeedoffset; + } + + /** + * @return double + */ + public function getArmor() + { + return $this->armor; + } + + /** + * @return double + */ + public function getHp() + { + return $this->hp; + } + + /** + * @return double + */ + public function getHpregenperlevel() + { + return $this->hpregenperlevel; + } + + /** + * @return double + */ + public function getSpellblock() + { + return $this->spellblock; + } + + /** + * @return double + */ + public function getAttackrange() + { + return $this->attackrange; + } + + /** + * @return double + */ + public function getMovespeed() + { + return $this->movespeed; + } + + /** + * @return double + */ + public function getAttackdamageperlevel() + { + return $this->attackdamageperlevel; + } + + /** + * @return double + */ + public function getMpregenperlevel() + { + return $this->mpregenperlevel; + } + + /** + * @return double + */ + public function getMp() + { + return $this->mp; + } + + /** + * @return double + */ + public function getSpellblockperlevel() + { + return $this->spellblockperlevel; + } + + /** + * @return double + */ + public function getCrit() + { + return $this->crit; + } + + /** + * @return double + */ + public function getMpregen() + { + return $this->mpregen; + } + + /** + * @return double + */ + public function getAttackspeedperlevel() + { + return $this->attackspeedperlevel; + } + + /** + * @return double + */ + public function getHpregen() + { + return $this->hpregen; + } + + /** + * @return double + */ + public function getCritperlevel() + { + return $this->critperlevel; + } + + /** + * @param double $armorperlevel + * + * @return $this + */ + public function setArmorperlevel($armorperlevel) + { + $this->armorperlevel = $armorperlevel; + + return $this; + } + + /** + * @param double $hpperlevel + * + * @return $this + */ + public function setHpperlevel($hpperlevel) + { + $this->hpperlevel = $hpperlevel; + + return $this; + } + + /** + * @param double $attackdamage + * + * @return $this + */ + public function setAttackdamage($attackdamage) + { + $this->attackdamage = $attackdamage; + + return $this; + } + + /** + * @param double $mpperlevel + * + * @return $this + */ + public function setMpperlevel($mpperlevel) + { + $this->mpperlevel = $mpperlevel; + + return $this; + } + + /** + * @param double $attackspeedoffset + * + * @return $this + */ + public function setAttackspeedoffset($attackspeedoffset) + { + $this->attackspeedoffset = $attackspeedoffset; + + return $this; + } + + /** + * @param double $armor + * + * @return $this + */ + public function setArmor($armor) + { + $this->armor = $armor; + + return $this; + } + + /** + * @param double $hp + * + * @return $this + */ + public function setHp($hp) + { + $this->hp = $hp; + + return $this; + } + + /** + * @param double $hpregenperlevel + * + * @return $this + */ + public function setHpregenperlevel($hpregenperlevel) + { + $this->hpregenperlevel = $hpregenperlevel; + + return $this; + } + + /** + * @param double $spellblock + * + * @return $this + */ + public function setSpellblock($spellblock) + { + $this->spellblock = $spellblock; + + return $this; + } + + /** + * @param double $attackrange + * + * @return $this + */ + public function setAttackrange($attackrange) + { + $this->attackrange = $attackrange; + + return $this; + } + + /** + * @param double $movespeed + * + * @return $this + */ + public function setMovespeed($movespeed) + { + $this->movespeed = $movespeed; + + return $this; + } + + /** + * @param double $attackdamageperlevel + * + * @return $this + */ + public function setAttackdamageperlevel($attackdamageperlevel) + { + $this->attackdamageperlevel = $attackdamageperlevel; + + return $this; + } + + /** + * @param double $mpregenperlevel + * + * @return $this + */ + public function setMpregenperlevel($mpregenperlevel) + { + $this->mpregenperlevel = $mpregenperlevel; + + return $this; + } + + /** + * @param double $mp + * + * @return $this + */ + public function setMp($mp) + { + $this->mp = $mp; + + return $this; + } + + /** + * @param double $spellblockperlevel + * + * @return $this + */ + public function setSpellblockperlevel($spellblockperlevel) + { + $this->spellblockperlevel = $spellblockperlevel; + + return $this; + } + + /** + * @param double $crit + * + * @return $this + */ + public function setCrit($crit) + { + $this->crit = $crit; + + return $this; + } + + /** + * @param double $mpregen + * + * @return $this + */ + public function setMpregen($mpregen) + { + $this->mpregen = $mpregen; + + return $this; + } + + /** + * @param double $attackspeedperlevel + * + * @return $this + */ + public function setAttackspeedperlevel($attackspeedperlevel) + { + $this->attackspeedperlevel = $attackspeedperlevel; + + return $this; + } + + /** + * @param double $hpregen + * + * @return $this + */ + public function setHpregen($hpregen) + { + $this->hpregen = $hpregen; + + return $this; + } + + /** + * @param double $critperlevel + * + * @return $this + */ + public function setCritperlevel($critperlevel) + { + $this->critperlevel = $critperlevel; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/SummonerDto.php b/src/LeagueWrap/Api/Dto/SummonerDto.php new file mode 100644 index 0000000..4cbdbf0 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/SummonerDto.php @@ -0,0 +1,152 @@ +profileIconId; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @return double + */ + public function getSummonerLevel() + { + return $this->summonerLevel; + } + + /** + * @return double + */ + public function getRevisionDate() + { + return $this->revisionDate; + } + + /** + * @return double + */ + public function getId() + { + return $this->id; + } + + /** + * @return double + */ + public function getAccountId() + { + return $this->accountId; + } + + /** + * @param int $profileIconId + * + * @return $this + */ + public function setProfileIconId($profileIconId) + { + $this->profileIconId = $profileIconId; + + return $this; + } + + /** + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * @param double $summonerLevel + * + * @return $this + */ + public function setSummonerLevel($summonerLevel) + { + $this->summonerLevel = $summonerLevel; + + return $this; + } + + /** + * @param double $revisionDate + * + * @return $this + */ + public function setRevisionDate($revisionDate) + { + $this->revisionDate = $revisionDate; + + return $this; + } + + /** + * @param double $id + * + * @return $this + */ + public function setId($id) + { + $this->id = $id; + + return $this; + } + + /** + * @param double $accountId + * + * @return $this + */ + public function setAccountId($accountId) + { + $this->accountId = $accountId; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/SummonerSpellDto.php b/src/LeagueWrap/Api/Dto/SummonerSpellDto.php new file mode 100644 index 0000000..4ef2db1 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/SummonerSpellDto.php @@ -0,0 +1,545 @@ +vars; + } + + /** + * @return ImageDto + */ + public function getImage() + { + return $this->image; + } + + /** + * @return string + */ + public function getCostBurn() + { + return $this->costBurn; + } + + /** + * @return double[] + */ + public function getCooldown() + { + return $this->cooldown; + } + + /** + * @return string[] + */ + public function getEffectBurn() + { + return $this->effectBurn; + } + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @return string + */ + public function getCooldownBurn() + { + return $this->cooldownBurn; + } + + /** + * @return string + */ + public function getTooltip() + { + return $this->tooltip; + } + + /** + * @return int + */ + public function getMaxrank() + { + return $this->maxrank; + } + + /** + * @return string + */ + public function getRangeBurn() + { + return $this->rangeBurn; + } + + /** + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * @return object[] + */ + public function getEffect() + { + return $this->effect; + } + + /** + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * @return LevelTipDto + */ + public function getLeveltip() + { + return $this->leveltip; + } + + /** + * @return string[] + */ + public function getModes() + { + return $this->modes; + } + + /** + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @return string + */ + public function getCostType() + { + return $this->costType; + } + + /** + * @return string + */ + public function getSanitizedDescription() + { + return $this->sanitizedDescription; + } + + /** + * @return string + */ + public function getSanitizedTooltip() + { + return $this->sanitizedTooltip; + } + + /** + * @return object + */ + public function getRange() + { + return $this->range; + } + + /** + * @return int[] + */ + public function getCost() + { + return $this->cost; + } + + /** + * @return int + */ + public function getSummonerLevel() + { + return $this->summonerLevel; + } + + /** + * @param SpellVarsDto[] $vars + * + * @return $this + */ + public function setVars($vars) + { + foreach ($vars as $key => $dtoData) { + $this->vars[$key] = new SpellVarsDto($dtoData); + } + + return $this; + } + + /** + * @param ImageDto $image + * + * @return $this + */ + public function setImage($image) + { + $this->image = new ImageDto($image); + + return $this; + } + + /** + * @param string $costBurn + * + * @return $this + */ + public function setCostBurn($costBurn) + { + $this->costBurn = $costBurn; + + return $this; + } + + /** + * @param double[] $cooldown + * + * @return $this + */ + public function setCooldown($cooldown) + { + $this->cooldown = $cooldown; + + return $this; + } + + /** + * @param string[] $effectBurn + * + * @return $this + */ + public function setEffectBurn($effectBurn) + { + $this->effectBurn = $effectBurn; + + return $this; + } + + /** + * @param int $id + * + * @return $this + */ + public function setId($id) + { + $this->id = $id; + + return $this; + } + + /** + * @param string $cooldownBurn + * + * @return $this + */ + public function setCooldownBurn($cooldownBurn) + { + $this->cooldownBurn = $cooldownBurn; + + return $this; + } + + /** + * @param string $tooltip + * + * @return $this + */ + public function setTooltip($tooltip) + { + $this->tooltip = $tooltip; + + return $this; + } + + /** + * @param int $maxrank + * + * @return $this + */ + public function setMaxrank($maxrank) + { + $this->maxrank = $maxrank; + + return $this; + } + + /** + * @param string $rangeBurn + * + * @return $this + */ + public function setRangeBurn($rangeBurn) + { + $this->rangeBurn = $rangeBurn; + + return $this; + } + + /** + * @param string $description + * + * @return $this + */ + public function setDescription($description) + { + $this->description = $description; + + return $this; + } + + /** + * @param object[] $effect + * + * @return $this + */ + public function setEffect($effect) + { + $this->effect = $effect; + + return $this; + } + + /** + * @param string $key + * + * @return $this + */ + public function setKey($key) + { + $this->key = $key; + + return $this; + } + + /** + * @param LevelTipDto $leveltip + * + * @return $this + */ + public function setLeveltip($leveltip) + { + $this->leveltip = new LevelTipDto($leveltip); + + return $this; + } + + /** + * @param string[] $modes + * + * @return $this + */ + public function setModes($modes) + { + $this->modes = $modes; + + return $this; + } + + /** + * @param string $resource + * + * @return $this + */ + public function setResource($resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * @param string $costType + * + * @return $this + */ + public function setCostType($costType) + { + $this->costType = $costType; + + return $this; + } + + /** + * @param string $sanitizedDescription + * + * @return $this + */ + public function setSanitizedDescription($sanitizedDescription) + { + $this->sanitizedDescription = $sanitizedDescription; + + return $this; + } + + /** + * @param string $sanitizedTooltip + * + * @return $this + */ + public function setSanitizedTooltip($sanitizedTooltip) + { + $this->sanitizedTooltip = $sanitizedTooltip; + + return $this; + } + + /** + * @param object $range + * + * @return $this + */ + public function setRange($range) + { + $this->range = $range; + + return $this; + } + + /** + * @param int[] $cost + * + * @return $this + */ + public function setCost($cost) + { + $this->cost = $cost; + + return $this; + } + + /** + * @param int $summonerLevel + * + * @return $this + */ + public function setSummonerLevel($summonerLevel) + { + $this->summonerLevel = $summonerLevel; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/SummonerSpellListDto.php b/src/LeagueWrap/Api/Dto/SummonerSpellListDto.php new file mode 100644 index 0000000..77bd20d --- /dev/null +++ b/src/LeagueWrap/Api/Dto/SummonerSpellListDto.php @@ -0,0 +1,85 @@ +data; + } + + /** + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * @param SummonerSpellDto[] $data Map[string, SummonerSpellDto] + * + * @return $this + */ + public function setData($data) + { + foreach ($data as $key => $dtoData) { + $this->data[$key] = new SummonerSpellDto($dtoData); + } + + return $this; + } + + /** + * @param string $version + * + * @return $this + */ + public function setVersion($version) + { + $this->version = $version; + + return $this; + } + + /** + * @param string $type + * + * @return $this + */ + public function setType($type) + { + $this->type = $type; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/TeamBansDto.php b/src/LeagueWrap/Api/Dto/TeamBansDto.php new file mode 100644 index 0000000..4e7e237 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/TeamBansDto.php @@ -0,0 +1,60 @@ +pickTurn; + } + + /** + * @return int + */ + public function getChampionId() + { + return $this->championId; + } + + /** + * @param int $pickTurn + * + * @return $this + */ + public function setPickTurn($pickTurn) + { + $this->pickTurn = $pickTurn; + + return $this; + } + + /** + * @param int $championId + * + * @return $this + */ + public function setChampionId($championId) + { + $this->championId = $championId; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/TeamStatsDto.php b/src/LeagueWrap/Api/Dto/TeamStatsDto.php new file mode 100644 index 0000000..2d1dcc3 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/TeamStatsDto.php @@ -0,0 +1,384 @@ +firstDragon; + } + + /** + * @return bool + */ + public function isFirstInhibitor() + { + return $this->firstInhibitor; + } + + /** + * @return TeamBansDto[] + */ + public function getBans() + { + return $this->bans; + } + + /** + * @return int + */ + public function getBaronKills() + { + return $this->baronKills; + } + + /** + * @return bool + */ + public function isFirstRiftHerald() + { + return $this->firstRiftHerald; + } + + /** + * @return bool + */ + public function isFirstBaron() + { + return $this->firstBaron; + } + + /** + * @return int + */ + public function getRiftHeraldKills() + { + return $this->riftHeraldKills; + } + + /** + * @return bool + */ + public function isFirstBlood() + { + return $this->firstBlood; + } + + /** + * @return int + */ + public function getTeamId() + { + return $this->teamId; + } + + /** + * @return bool + */ + public function isFirstTower() + { + return $this->firstTower; + } + + /** + * @return int + */ + public function getVilemawKills() + { + return $this->vilemawKills; + } + + /** + * @return int + */ + public function getInhibitorKills() + { + return $this->inhibitorKills; + } + + /** + * @return int + */ + public function getTowerKills() + { + return $this->towerKills; + } + + /** + * @return int + */ + public function getDominionVictoryScore() + { + return $this->dominionVictoryScore; + } + + /** + * @return string + */ + public function getWin() + { + return $this->win; + } + + /** + * @return int + */ + public function getDragonKills() + { + return $this->dragonKills; + } + + /** + * @param bool $firstDragon + * + * @return $this + */ + public function setFirstDragon($firstDragon) + { + $this->firstDragon = $firstDragon; + + return $this; + } + + /** + * @param bool $firstInhibitor + * + * @return $this + */ + public function setFirstInhibitor($firstInhibitor) + { + $this->firstInhibitor = $firstInhibitor; + + return $this; + } + + /** + * @param TeamBansDto[] $bans + * + * @return $this + */ + public function setBans($bans) + { + foreach ($bans as $key => $dtoData) { + $this->bans[$key] = new TeamBansDto($dtoData); + } + + return $this; + } + + /** + * @param int $baronKills + * + * @return $this + */ + public function setBaronKills($baronKills) + { + $this->baronKills = $baronKills; + + return $this; + } + + /** + * @param bool $firstRiftHerald + * + * @return $this + */ + public function setFirstRiftHerald($firstRiftHerald) + { + $this->firstRiftHerald = $firstRiftHerald; + + return $this; + } + + /** + * @param bool $firstBaron + * + * @return $this + */ + public function setFirstBaron($firstBaron) + { + $this->firstBaron = $firstBaron; + + return $this; + } + + /** + * @param int $riftHeraldKills + * + * @return $this + */ + public function setRiftHeraldKills($riftHeraldKills) + { + $this->riftHeraldKills = $riftHeraldKills; + + return $this; + } + + /** + * @param bool $firstBlood + * + * @return $this + */ + public function setFirstBlood($firstBlood) + { + $this->firstBlood = $firstBlood; + + return $this; + } + + /** + * @param int $teamId + * + * @return $this + */ + public function setTeamId($teamId) + { + $this->teamId = $teamId; + + return $this; + } + + /** + * @param bool $firstTower + * + * @return $this + */ + public function setFirstTower($firstTower) + { + $this->firstTower = $firstTower; + + return $this; + } + + /** + * @param int $vilemawKills + * + * @return $this + */ + public function setVilemawKills($vilemawKills) + { + $this->vilemawKills = $vilemawKills; + + return $this; + } + + /** + * @param int $inhibitorKills + * + * @return $this + */ + public function setInhibitorKills($inhibitorKills) + { + $this->inhibitorKills = $inhibitorKills; + + return $this; + } + + /** + * @param int $towerKills + * + * @return $this + */ + public function setTowerKills($towerKills) + { + $this->towerKills = $towerKills; + + return $this; + } + + /** + * @param int $dominionVictoryScore + * + * @return $this + */ + public function setDominionVictoryScore($dominionVictoryScore) + { + $this->dominionVictoryScore = $dominionVictoryScore; + + return $this; + } + + /** + * @param string $win + * + * @return $this + */ + public function setWin($win) + { + $this->win = $win; + + return $this; + } + + /** + * @param int $dragonKills + * + * @return $this + */ + public function setDragonKills($dragonKills) + { + $this->dragonKills = $dragonKills; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/TournamentCodeDto.php b/src/LeagueWrap/Api/Dto/TournamentCodeDto.php new file mode 100644 index 0000000..8efbe04 --- /dev/null +++ b/src/LeagueWrap/Api/Dto/TournamentCodeDto.php @@ -0,0 +1,313 @@ +map; + } + + /** + * @return string + */ + public function getCode() + { + return $this->code; + } + + /** + * @return string + */ + public function getSpectators() + { + return $this->spectators; + } + + /** + * @return Region + */ + public function getRegion() + { + return $this->region; + } + + /** + * @return int + */ + public function getProviderId() + { + return $this->providerId; + } + + /** + * @return int + */ + public function getTeamSize() + { + return $this->teamSize; + } + + /** + * @return double[] + */ + public function getParticipants() + { + return $this->participants; + } + + /** + * @return string + */ + public function getPickType() + { + return $this->pickType; + } + + /** + * @return int + */ + public function getTournamentId() + { + return $this->tournamentId; + } + + /** + * @return string + */ + public function getLobbyName() + { + return $this->lobbyName; + } + + /** + * @return string + */ + public function getPassword() + { + return $this->password; + } + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @return string + */ + public function getMetaData() + { + return $this->metaData; + } + + /** + * @param string $map + * + * @return $this + */ + public function setMap($map) + { + $this->map = $map; + + return $this; + } + + /** + * @param string $code + * + * @return $this + */ + public function setCode($code) + { + $this->code = $code; + + return $this; + } + + /** + * @param string $spectators + * + * @return $this + */ + public function setSpectators($spectators) + { + $this->spectators = $spectators; + + return $this; + } + + /** + * @param Region $region + * + * @return $this + */ + public function setRegion($region) + { + $this->region = $region; + + return $this; + } + + /** + * @param int $providerId + * + * @return $this + */ + public function setProviderId($providerId) + { + $this->providerId = $providerId; + + return $this; + } + + /** + * @param int $teamSize + * + * @return $this + */ + public function setTeamSize($teamSize) + { + $this->teamSize = $teamSize; + + return $this; + } + + /** + * @param double[] $participants + * + * @return $this + */ + public function setParticipants($participants) + { + $this->participants = $participants; + + return $this; + } + + /** + * @param string $pickType + * + * @return $this + */ + public function setPickType($pickType) + { + $this->pickType = $pickType; + + return $this; + } + + /** + * @param int $tournamentId + * + * @return $this + */ + public function setTournamentId($tournamentId) + { + $this->tournamentId = $tournamentId; + + return $this; + } + + /** + * @param string $lobbyName + * + * @return $this + */ + public function setLobbyName($lobbyName) + { + $this->lobbyName = $lobbyName; + + return $this; + } + + /** + * @param string $password + * + * @return $this + */ + public function setPassword($password) + { + $this->password = $password; + + return $this; + } + + /** + * @param int $id + * + * @return $this + */ + public function setId($id) + { + $this->id = $id; + + return $this; + } + + /** + * @param string $metaData + * + * @return $this + */ + public function setMetaData($metaData) + { + $this->metaData = $metaData; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Dto/Translation.php b/src/LeagueWrap/Api/Dto/Translation.php new file mode 100644 index 0000000..843eb0b --- /dev/null +++ b/src/LeagueWrap/Api/Dto/Translation.php @@ -0,0 +1,83 @@ +locale; + } + + /** + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * @return string + */ + public function getUpdated_at() + { + return $this->updated_at; + } + + /** + * @param string $locale + * + * @return $this + */ + public function setLocale($locale) + { + $this->locale = $locale; + + return $this; + } + + /** + * @param string $content + * + * @return $this + */ + public function setContent($content) + { + $this->content = $content; + + return $this; + } + + /** + * @param string $updated_at + * + * @return $this + */ + public function setUpdated_at($updated_at) + { + $this->updated_at = $updated_at; + + return $this; + } + +} diff --git a/src/LeagueWrap/Api/Endpoint.php b/src/LeagueWrap/Api/Endpoint.php new file mode 100644 index 0000000..06de990 --- /dev/null +++ b/src/LeagueWrap/Api/Endpoint.php @@ -0,0 +1,50 @@ +getHeaderLine('X-Endpoint'); + + if (! isset(BaseApi::$endpointDefinitions[$name])) { + throw new \InvalidArgumentException('Could not resolve Endpoint from the provided response: \n'.$response->getBody()->__toString()); + } + + /** @var BaseEndpoint $endpointClass */ + $endpointClass = BaseApi::$endpointDefinitions[$name]['class']; + + return new $endpointClass(Region::create($response->getHeaderLine('X-Region'))); + } + + /** + * @param RequestInterface $request + * + * @return null|Endpoint + */ + public static function fromRequest(RequestInterface $request) + { + if ($request->hasHeader('X-Endpoint')) { + $name = $request->getHeaderLine('X-Endpoint'); + + if (! isset(BaseApi::$endpointDefinitions[$name])) { + throw new \InvalidArgumentException('Could not resolve Endpoint from the request: \n'.$request->getRequestTarget()); + } + + /** @var BaseEndpoint $endpointClass */ + $endpointClass = BaseApi::$endpointDefinitions[$name]['class']; + + return new $endpointClass(Region::create($request->getHeaderLine('X-Region'))); + } + + $matchingScore = -1; + /** @var Endpoint $endpointInstance */ + $endpointInstance = null; + + foreach (BaseApi::$endpointDefinitions as $urlTemplate => $definition) { + $score = levenshtein($request->getRequestTarget(), $urlTemplate); + if ($score > $matchingScore) { + $matchingScore = $score; + $endpointInstance = $definition['instance']; + } + } + + return $endpointInstance; + } +} diff --git a/src/LeagueWrap/Api/Endpoints/ChampionMastery.php b/src/LeagueWrap/Api/Endpoints/ChampionMastery.php new file mode 100644 index 0000000..807d819 --- /dev/null +++ b/src/LeagueWrap/Api/Endpoints/ChampionMastery.php @@ -0,0 +1,14 @@ +getAsync( + $this->createEndpointsFromIds($ids, MatchById::class) + ); + } + + public function getByIds(array $ids) + { + return $this->byIds($ids); + } +} diff --git a/src/LeagueWrap/Api/Platform.php b/src/LeagueWrap/Api/Platform.php new file mode 100644 index 0000000..347e4c0 --- /dev/null +++ b/src/LeagueWrap/Api/Platform.php @@ -0,0 +1,11 @@ +keyGenerator = $keyGenerator ?: new KeyGenerator(); + $this->streamFactory = $streamFactory ?: StreamFactoryDiscovery::find(); + $this->cache = $cache; + $this->options = $options; + } + + /** + * Handle the request and return the response coming from the next callable. + * + * @see http://docs.php-http.org/en/latest/plugins/build-your-own.html + * + * @param RequestInterface $request + * @param callable $next Next middleware in the chain, the request is passed as the first argument + * @param callable $first First middleware in the chain, used to restart a request + * + * @return Promise Resolves a PSR-7 Result or fails with an Http\Client\Exception (The same as HttpAsyncClient). + */ + public function handleRequest(RequestInterface $request, callable $next, callable $first) + { + if (strtoupper($request->getMethod()) !== 'GET') { + $next($request); + } + + $key = $this->keyGenerator->generate($request); + $cacheItem = $this->cache->getItem($key); + + if ($cacheItem->isHit()) { + return new FulfilledPromise($this->createResponseFromCacheItem($cacheItem)); + } + + return $next($request)->then(function (ResponseInterface $response) use ($request, $cacheItem) { + if ($this->isCacheable($response)) { + $bodyStream = $response->getBody(); + $body = $bodyStream->__toString(); + + if ($bodyStream->isSeekable()) { + $bodyStream->rewind(); + } else { + $response = $response->withBody($this->streamFactory->createStream($body)); + } + + $cacheItem + ->expiresAfter($this->calculateCacheItemTtl($request)) + ->set([ + 'response' => $response, + 'body' => $body, + 'createdAt' => time(), + ]); + + $this->cache->save($cacheItem); + } + + return $response; + }); + } + + /** + * @param CacheItemInterface $cacheItem + * + * @return ResponseInterface + */ + private function createResponseFromCacheItem(CacheItemInterface $cacheItem) + { + $data = $cacheItem->get(); + + /** @var ResponseInterface $response */ + $response = $data['response']; + + $stream = $this->streamFactory->createStream($data['body']); + + try { + $stream->rewind(); + } catch (\Exception $e) { + throw new RewindStreamException('Cannot rewind stream.', 0, $e); + } + + return $response->withBody($stream)->withAddedHeader('X-From-Cache', $data['createdAt']); + } + + /** + * Verify that we can cache this response. + * + * @param ResponseInterface $response + * + * @return bool + */ + protected function isCacheable(ResponseInterface $response) + { + // TODO: Add option to cache 4xx responses + if (!in_array($response->getStatusCode(), [200, 203, 300, 301, 302])) { + return false; + } + + return true; + } + + /** + * Calculate how long should the request be cached for. + * If the $options array from the constructor contains 'endpoints' key + * with nested fully qualified class name of the Endpoint, + * the default TTL is overwritten by the provided value. + * + * @param RequestInterface $request + * + * @return int + */ + protected function calculateCacheItemTtl(RequestInterface $request) + { + $endpoint = EndpointFinder::fromRequest($request); + + if (isset($this->options['endpoints']) && isset($this->options['endpoints'][get_class($endpoint)])) { + return $this->options['endpoints'][get_class($endpoint)]; + } + + return $endpoint->getCacheLifeTime(); + } +} diff --git a/src/LeagueWrap/Cache/KeyGenerator.php b/src/LeagueWrap/Cache/KeyGenerator.php new file mode 100644 index 0000000..0fd349d --- /dev/null +++ b/src/LeagueWrap/Cache/KeyGenerator.php @@ -0,0 +1,48 @@ +getUri()->__toString()); + } + + /** + * Generate cache key from an Endpoint. + * + * @param Endpoint $endpoint + * + * @return string + */ + public static function fromEndpoint(Endpoint $endpoint) + { + return static::generateKey(strtolower($endpoint->getRegion()->getDomain()).$endpoint->getUrl()); + } +} diff --git a/src/LeagueWrap/Client.php b/src/LeagueWrap/Client.php new file mode 100644 index 0000000..59b590b --- /dev/null +++ b/src/LeagueWrap/Client.php @@ -0,0 +1,193 @@ +httpClientBuilder = $builder ?: new ClientBuilder(); + + $region = $region ?: 'euw'; + $this->region = is_string($region) ? Region::create($region) : $region; + + $this->httpClientBuilder + ->addPlugin(new RedirectPlugin()) + ->addPlugin(new AddHostPlugin(UriFactoryDiscovery::find()->createUri($this->region->getDomain()))) + ->addPlugin(new HeaderDefaultsPlugin([ + 'User-Agent' => self::$name.' '.self::$version, + self::AUTH_HEADER => $apiKey, + ])); + + $this->appRateLimiter = new VoidRateLimiter(); + $this->methodRateLimiter = new VoidRateLimiter(); + } + + public function api($name) + { + switch ($name) { + case 'match': + $api = new Api\Match($this, $this->region); + break; + case 'league': + $api = new Api\League($this, $this->region); + break; + case 'spectator': + $api = new Api\Spectator($this, $this->region); + break; + case 'status': + $api = new Api\Status($this, $this->region); + break; + case 'championMastery': + case 'champion_mastery': + $api = new Api\ChampionMastery($this, $this->region); + break; + case 'platform': + case 'champion': + case 'champions': + case 'mastery': + case 'masteries': + case 'rune': + case 'runes': + $api = new Api\Platform($this, $this->region); + break; + case 'staticData': + case 'static_data': + $api = new Api\StaticData($this, $this->region); + break; + default: + throw new \InvalidArgumentException("Could not create '{$name}' API instance."); + } + + return $api; + } + + public function setApiKey($apiKey) + { + $this->httpClientBuilder->addHeader(self::AUTH_HEADER, $apiKey); + } + + public function addCache(CacheItemPoolInterface $pool, array $options = []) + { + $this->cache = $pool; + $this->getHttpClientBuilder()->addCache($pool, $options); + + return $this; + } + + public function removeCache() + { + $this->getHttpClientBuilder()->removeCache(); + $this->cache = null; + + return $this; + } + + public function getCache() + { + return $this->cache; + } + + public function setAppLimits(array $limits, CacheItemPoolInterface $pool = null) + { + $this->appRateLimiter = new AppRateLimiter($pool ?: CacheItemPoolFactory::make('fs'), $limits); + + return $this; + } + + public function getAppRateLimiter() + { + return $this->appRateLimiter; + } + + public function setMethodLimits(array $limits, CacheItemPoolInterface $pool = null) + { + $this->methodRateLimiter = new MethodRateLimiter($pool ?: CacheItemPoolFactory::make('fs'), $limits); + + return $this; + } + + public function getMethodRateLimiter() + { + return $this->methodRateLimiter; + } + + /** + * @return PluginClient + */ + public function getHttpClient() + { + return $this->getHttpClientBuilder()->getHttpClient(); + } + /** + * @return ClientBuilder + */ + protected function getHttpClientBuilder() + { + return $this->httpClientBuilder; + } + + public function __call($name, $args) + { + return $this->api($name); + } +} diff --git a/src/LeagueWrap/Enum/GameMode.php b/src/LeagueWrap/Enum/GameMode.php new file mode 100644 index 0000000..0fd703f --- /dev/null +++ b/src/LeagueWrap/Enum/GameMode.php @@ -0,0 +1,30 @@ +httpClient = $httpClient ?: HttpClientDiscovery::find(); + $this->requestFactory = $requestFactory ?: MessageFactoryDiscovery::find(); + $this->streamFactory = $streamFactory ?: StreamFactoryDiscovery::find(); + } + + /** + * @return PluginClient + */ + public function getHttpClient() + { + if (!$this->httpClientModified) { + return $this->client; + } + + $this->httpClientModified = false; + + if ($this->cachePlugin) { + $this->plugins[] = $this->cachePlugin; + } + + return ($this->client = new PluginClient($this->httpClient, $this->plugins)); + } + + /** + * Append a new plugin. + * + * @param Plugin $plugin + * + * @return $this + */ + public function addPlugin(Plugin $plugin) + { + $this->plugins[] = $plugin; + $this->httpClientModified = true; + + return $this; + } + + /** + * Remove a plugin by its fully qualified class name (FQCN). + * + * @param string $fqcn + */ + public function removePlugin($fqcn) + { + foreach ($this->plugins as $idx => $plugin) { + if ($plugin instanceof $fqcn) { + unset($this->plugins[$idx]); + $this->httpClientModified = true; + } + } + } + + /** + * @param string $header + * @param string $headerValue + */ + public function addHeader($header, $headerValue) + { + if (!isset($this->headers[$header])) { + $this->headers[$header] = $headerValue; + } else { + $this->headers[$header] = array_merge((array)$this->headers[$header], array($headerValue)); + } + $this->removePlugin(Plugin\HeaderAppendPlugin::class); + $this->addPlugin(new Plugin\HeaderAppendPlugin($this->headers)); + } + + public function addCache(CacheItemPoolInterface $pool, array $options) + { + if (! isset($options['cache_key_generator'])) { + $options['cache_key_generator'] = new KeyGenerator(); + } + + $this->cachePlugin = new CachePlugin($pool, $this->streamFactory, $options['cache_key_generator'], $options); + + $this->httpClientModified = true; + } + + public function removeCache() + { + $this->cachePlugin = null; + + $this->httpClientModified = true; + } +} diff --git a/src/LeagueWrap/Http/Response/Transformer.php b/src/LeagueWrap/Http/Response/Transformer.php new file mode 100644 index 0000000..adfe700 --- /dev/null +++ b/src/LeagueWrap/Http/Response/Transformer.php @@ -0,0 +1,18 @@ +getBody()->__toString(), true); + } +} diff --git a/src/LeagueWrap/RateLimit/AppRateLimiter.php b/src/LeagueWrap/RateLimit/AppRateLimiter.php new file mode 100644 index 0000000..f6ba892 --- /dev/null +++ b/src/LeagueWrap/RateLimit/AppRateLimiter.php @@ -0,0 +1,103 @@ +store = new PrefixedCachePool($cachePool, self::CACHE_PREFIX); + $this->limits = new Limits($limits); + } + + /** + * Fetch current limit for specified time window. + * + * @param Region $region + * @param string $timeWindow + * + * @return \Psr\Cache\CacheItemInterface + */ + public function get($region, $timeWindow = '10') + { + return $this->store->getItem("{$region->getName()}.{$timeWindow}"); + } + + /** + * Try to perform $count hits. + * + * @param Endpoint $endpoint + * @param int $count + * + * @throws RateLimitReachedException + * + * @return bool + */ + public function hit(Endpoint $endpoint, $count = 1) + { + $region = $endpoint->getRegion(); + $limitsForRegion = $this->limits->getLimitsForRegion($region); + + foreach ($limitsForRegion as $time => $limit) { + // Get the respective time limit for this region + $item = $this->get($region, $time); + + // No results found, create new count for the limit + if (! $item->isHit()) { + $item->set($count)->expiresAfter($time); + $this->store->save($item); + continue; + } + + // Otherwise there is a count saved for the region, + // check if the request count can be performed. + $currentCount = $item->get(); + if ($count + $currentCount > $limit) { + $message = "Sending {$count} request".($count === 1 ? '' : 's')." is not allowed! ". + "Rate limit for '{$region->getName()}' reached. Current count: {$currentCount}. Limits:". + array_reduce(array_keys($limitsForRegion), function ($str, $time) use ($limitsForRegion) { + return "{$str} {$limitsForRegion[$time]}/{$time}s"; + }, ''); + throw new RateLimitReachedException($message); + } + + // If it can, increase the current limit + $item->set($currentCount + $count); + $this->store->save($item); + } + + return true; + } + + /** + * {@inheritdoc} + */ + public function clear() + { + return $this->store->clear(); + } +} diff --git a/src/LeagueWrap/RateLimit/Limits.php b/src/LeagueWrap/RateLimit/Limits.php new file mode 100644 index 0000000..77c5f78 --- /dev/null +++ b/src/LeagueWrap/RateLimit/Limits.php @@ -0,0 +1,24 @@ + $platformId) { + foreach ($limits as $time => $limit) { + $this->limits[$regionName][$time] = $limit; + } + } + } + + public function getLimitsForRegion($region) + { + return $this->limits[Region::create($region)->getName()]; + } +} diff --git a/src/LeagueWrap/RateLimit/MethodRateLimiter.php b/src/LeagueWrap/RateLimit/MethodRateLimiter.php new file mode 100644 index 0000000..02e93d4 --- /dev/null +++ b/src/LeagueWrap/RateLimit/MethodRateLimiter.php @@ -0,0 +1,102 @@ +store = new PrefixedCachePool($cachePool, self::CACHE_PREFIX); + $this->limits = $limits; + } + + /** + * Try to perform $count hits. + * + * @param Endpoint $endpoint + * @param int $count + * + * @throws RateLimitReachedException + * + * @return bool + */ + public function hit(Endpoint $endpoint, $count = 1) + { + $region = $endpoint->getRegion(); + + $rateLimit = isset($this->limits[get_class($endpoint)]) ? $this->limits[get_class($endpoint)] : $endpoint->getLimit(); + + $time = array_keys($rateLimit)[0]; + $limit = $rateLimit[$time]; + + // Get the respective time limit for this region + $item = $this->get($endpoint, $time); + + // No results found, create new count for the limit + if (! $item->isHit()) { + $item->set($count)->expiresAfter($time); + $this->store->save($item); + + return true; + } + + // Otherwise there is a count saved for region+method, + // check if the request count can be performed. + $currentCount = $item->get(); + if ($count + $currentCount > $limit) { + throw new RateLimitReachedException( + "Sending {$count} request".($count === 1) ? '' : 's'." is not allowed! ". + "Rate limit for '{$endpoint->getName()}' ({$region->getName()}) reached. ". + "Current count: {$currentCount}. Limit: {$limit}/{$time}s." + ); + } + + // If it can, increase the current limit + $item->set($currentCount + $count); + $this->store->save($item); + + return true; + } + + /** + * Fetch current limit for specified time window. + * + * @param Endpoint $endpoint + * @param string $timeWindow + * + * @return \Psr\Cache\CacheItemInterface + */ + public function get($endpoint, $timeWindow = '10') + { + return $this->store->getItem("{$endpoint->getRegion()->getName()}.".str_replace(['/', '{', '}'], ['_', '', ''], $endpoint->getName()).".{$timeWindow}"); + } + + /** + * Deletes all rate limits in the pool. + * + * @return bool + */ + public function clear() + { + return $this->store->clear(); + } +} diff --git a/src/LeagueWrap/RateLimit/RateLimiter.php b/src/LeagueWrap/RateLimit/RateLimiter.php new file mode 100644 index 0000000..7429f66 --- /dev/null +++ b/src/LeagueWrap/RateLimit/RateLimiter.php @@ -0,0 +1,41 @@ + 'NA1', + 'euw' => 'EUW1', + 'br' => 'BR1', + 'lan' => 'LA1', + 'las' => 'LA2', + 'oce' => 'OC1', + 'eune' => 'EUN1', + 'tr' => 'TR1', + 'ru' => 'RU', + 'kr' => 'KR', + 'jp' => 'JP1', + ]; + + protected $apiDomain = 'https://{platform}.api.riotgames.com'; + + /** + * Region constructor. + * + * @param $name + */ + public function __construct($name) + { + $name = strtolower($name); + + if (! array_key_exists($name, self::PLATFORM_IDS)) { + throw new \LogicException('Unsupported region.'); + } + + $this->selected = $name; + } + + public static function create($region) + { + return $region instanceof self ? $region : new self($region); + } + + public function getDomain() + { + return str_replace('{platform}', self::PLATFORM_IDS[$this->selected], $this->apiDomain); + } + + public function getName() + { + return $this->selected; + } + + public function getPlatformId() + { + return self::PLATFORM_IDS[$this->selected]; + } +} diff --git a/src/LeagueWrap/Results/BatchResult.php b/src/LeagueWrap/Results/BatchResult.php new file mode 100644 index 0000000..4302b6d --- /dev/null +++ b/src/LeagueWrap/Results/BatchResult.php @@ -0,0 +1,163 @@ +data = $data; + $this->responses = $responses; + } + + public static function fromSettledPromises(array $results) + { + $fulfilled = array_filter($results, function ($inspection) { + return $inspection['state'] === Promise::FULFILLED; + }); + + // TODO: Add access to rejected responses + $rejected = array_filter($results, function ($inspection) { + return $inspection['state'] === Promise::REJECTED; + }); + + /** @var Result[] $responses */ + $responses = array_map(function ($inspection) { + return Result::fromPsr7($inspection['value']); + }, $fulfilled); + + // TODO: Sort the async responses in order they were sent + usort($responses, function (Result $a, Result $b) { + $aLimit = $a->getAppRateLimit(); + $bLimit = $b->getAppRateLimit(); + + if ($aLimit === null || $bLimit === null) { + return 0; + } + + return (end($aLimit) < end($bLimit)) ? -1 : 1; + }); + + /** @var array $data */ + $data = array_map(function (Result $response) { + return \GuzzleHttp\json_decode((string) $response->getResponse()->getBody(), true); + }, $responses); + + return new self($data, $responses); + } + + /** + * @return array + */ + public function getData() + { + return $this->data; + } + + /** + * @return Result[] + */ + public function getResponses() + { + return $this->responses; + } + + /** + * @return string + */ + public function __toString() + { + // Print request / response timings and rate limit headers + return array_reduce($this->responses, function ($carry, Result $response) { + $psrResponse = $response->getResponse(); + + return $carry.PHP_EOL. + "Request: {$psrResponse->getHeaderLine('X-Request')}".PHP_EOL. + "Endpoint: {$psrResponse->getHeaderLine('X-Endpoint')} ({$psrResponse->getHeaderLine('X-Region')})".PHP_EOL. + "Started: {$psrResponse->getHeaderLine('X-Start')} -> {$psrResponse->getHeaderLine('X-Duration')}s".PHP_EOL. + "Ended: {$psrResponse->getHeaderLine('X-End')}".PHP_EOL. + "App limits: {$psrResponse->getHeaderLine('X-App-Rate-Limit-Count')} ({$psrResponse->getHeaderLine('X-App-Rate-Limit')})".PHP_EOL. + "Method limits: {$psrResponse->getHeaderLine('X-Method-Rate-Limit-Count')} ({$psrResponse->getHeaderLine('X-Method-Rate-Limit')})". + PHP_EOL; + }, ''); + } + + /** + * Determine if the given offset exists. + * + * @param string $offset + * + * @return bool + */ + public function offsetExists($offset) + { + return $this->exists($this->data, $offset); + } + + /** + * Get the value at the given offset. + * + * @param string $offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return $this->get($this->data, $offset); + } + + /** + * Set the value at the given offset. + * + * @param string $offset + * @param mixed $value + * + * @return void + */ + public function offsetSet($offset, $value) + { + $this->set($this->data, $offset, $value); + } + + /** + * Remove the value at the given offset. + * + * @param string $offset + * + * @return void + */ + public function offsetUnset($offset) { + $this->unset_($this->data, $offset); + } + + /** + * Retrieve an external iterator + */ + public function getIterator() + { + return new \ArrayIterator($this->data); + } + + /** + * Count elements of an object + */ + public function count() + { + return count($this->data); + } +} diff --git a/src/LeagueWrap/Results/Result.php b/src/LeagueWrap/Results/Result.php new file mode 100644 index 0000000..ccc9899 --- /dev/null +++ b/src/LeagueWrap/Results/Result.php @@ -0,0 +1,173 @@ +content = $content; + $this->response = $response; + } + + + public static function fromPsr7(ResponseInterface $response) + { + return new self( + \GuzzleHttp\json_decode((string) $response->getBody(), true), + $response + ); + } + + /** + * @return mixed + */ + public function getContent() + { + return $this->content; + } + + /** + * @return string[][] + */ + public function getHeaders() + { + return $this->response->getHeaders(); + } + + /** + * @return int + */ + public function getStatus() + { + return $this->response->getStatusCode(); + } + + /** + * @return ResponseInterface|null + */ + public function getResponse() + { + return $this->response; + } + + public function getAppRateLimit() + { + return $this->getRateLimitValuesByHeader(self::APP_RATE_LIMIT_HEADER); + } + + public function getMethodRateLimit() + { + return $this->getRateLimitValuesByHeader(self::METHOD_RATE_LIMIT_HEADER); + } + + /** + * Extract rate limits from given header. + * Header value is in form "count:time_limit,count:another_time_limit". + * Format returned is [ (int) time_limit => (int) count, ... ]. + * + * @param $headerName + * + * @return int[][]|null + */ + protected function getRateLimitValuesByHeader($headerName) + { + $header = $this->getHeaders()[$headerName]; + + return $header ? array_reduce(explode(',', $header[0]), function ($limits, $limitStr) { + list($count, $time) = explode(':', $limitStr, 2); + $limits[$time] = (int) $count; + + return $limits; + }, []) : null; + } + + /** + * Determine if the given offset exists. + * + * @param string $offset + * + * @return bool + */ + public function offsetExists($offset) + { + return $this->exists($this->content, $offset); + } + + /** + * Get the value at the given offset. + * + * @param string $offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return $this->get($this->content, $offset); + } + + /** + * Set the value at the given offset. + * + * @param string $offset + * @param mixed $value + * + * @return void + */ + public function offsetSet($offset, $value) + { + $this->set($this->content, $offset, $value); + } + + /** + * Remove the value at the given offset. + * + * @param string $offset + * + * @return void + */ + public function offsetUnset($offset) { + $this->unset_($this->content, $offset); + } + + /** + * Retrieve an external iterator + */ + public function getIterator() + { + return new \ArrayIterator($this->content); + } + + /** + * Count elements of an object + */ + public function count() + { + return count($this->content); + } +} diff --git a/src/LeagueWrap/Traits/ArrayAccessible.php b/src/LeagueWrap/Traits/ArrayAccessible.php new file mode 100644 index 0000000..14b37f9 --- /dev/null +++ b/src/LeagueWrap/Traits/ArrayAccessible.php @@ -0,0 +1,98 @@ + 1) { + $part = array_shift($parts); + + if (!isset($array[$part]) or !is_array($array[$part])) { + $array[$part] = []; + } + + $array =& $array[$part]; + } + + $array[array_shift($parts)] = $value; + } + + /** + * @param array $array + * @param string $key + */ + protected function unset_(array &$array, $key) + { + $parts = explode(".", $key); + + while (count($parts) > 1) { + $part = array_shift($parts); + + if (isset($array[$part]) and is_array($array[$part])) { + $array =& $array[$part]; + } + } + + unset($array[array_shift($parts)]); + } +} diff --git a/tests/BaseIntegrationTestCase.php b/tests/BaseIntegrationTestCase.php new file mode 100644 index 0000000..bfa3611 --- /dev/null +++ b/tests/BaseIntegrationTestCase.php @@ -0,0 +1,63 @@ +markTestSkipped( + 'Cannot run integration tests without an API key.'.PHP_EOL. + 'Use `export RIOT_API_KEY=my-key` or create `.env.test` file with `RIOT_API_KEY=my-key` as content to set it.' + ); + } + + $this->api = (new Client(getenv('RIOT_API_KEY'), 'euw')); + } + + /** + * Override PHPUnit's method for handling unsuccessful tests. + * + * @param Throwable $t + */ + protected function onNotSuccessfulTest(Throwable $t) + { + // In case 5xx mark the test as incomplete + if ($t instanceof ServerException) { + self::markTestIncomplete( + 'Skipping "'. + self::getName().'"'.PHP_EOL. + ' url: '. + "[{$t->getResponse()->getStatusCode()}] ".$t->getRequest()->getRequestTarget().PHP_EOL. + ' data: '. + (string) $t->getResponse()->getBody() + ); + } + + parent::onNotSuccessfulTest($t); + } + + /** + * Skip a test when Paratest or more than one tests are running. + */ + protected function skipRateLimitedTest() + { + if ($this->getTestResultObject()->count() !== 1 && getenv('TEST_TOKEN') === false) { + $this->markTestSkipped('Rate limit tests can be only ran one at a time.'); + } + } +} diff --git a/tests/Integration/LeagueApiTest.php b/tests/Integration/LeagueApiTest.php new file mode 100644 index 0000000..d7ad34b --- /dev/null +++ b/tests/Integration/LeagueApiTest.php @@ -0,0 +1,24 @@ +api->league()->getChallenger('RANKED_SOLO_5x5'); + + $this->assertEquals('RANKED_SOLO_5x5', $response['queue']); + } + + /** @test */ + public function league_fetches_the_master_ladder() + { + $response = $this->api->league()->getMaster('RANKED_SOLO_5x5'); + + $this->assertEquals('RANKED_SOLO_5x5', $response['queue']); + } +} diff --git a/tests/Integration/MatchApiTest.php b/tests/Integration/MatchApiTest.php new file mode 100644 index 0000000..e26074e --- /dev/null +++ b/tests/Integration/MatchApiTest.php @@ -0,0 +1,202 @@ +api->match()->getById(3152860584); + + $this->assertEquals(3152860584, $result['gameId']); + } + + /** @test Provide an alternative way to access `match v3` endpoint. */ + public function match_endpoint_with_alternative_call_returns_a_single_match() + { + $result = $this->api->match()->byId(3152860584); + + $this->assertEquals(3152860584, $result['gameId']); + } + + /** @test Batch calls for `match v3` */ + public function multiple_matches_through_a_batch_call() + { + $result = $this->api->match()->byIds([ + 3152860584, + 3152860584, + 3152860584, + 3152860584, + ]); + + $this->assertBatchResponse($result); + $this->assertCount(4, $result->getResponses()); + $this->assertEquals(3152860584, $result->getData()[0]['gameId']); + } + + /** @test Batch calls for `match v3` the alternative way */ + public function multiple_matches_through_a_batch_call_with_alternative_call() + { + $result = $this->api->match()->byId([ + 3152860584, + 3152860584, + ]); + + $this->assertBatchResponse($result); + $this->assertCount(2, $result->getResponses()); + $this->assertEquals(3152860584, $result->getData()[0]['gameId']); + } + + /** @test */ + public function rate_limited_matches_with_app_limits() + { + $cache = []; + $pool = new ArrayCachePool(1000, $cache); + + $this->api->setAppLimits([ + '10' => 2, + ], $pool); + + $result = $this->api->match()->byIds([ + 3152860584, + 3152860584, + 3152860584, // rate limit is 2 so these calls won't get executed + 3152860584, + ]); + + $this->assertCount(2, $result->getResponses()); + $this->assertEquals(3152860584, $result->getData()[0]['gameId']); + $this->assertEquals(3152860584, $result->getData()[1]['gameId']); + } + + /** @test */ + public function rate_limited_matches_with_method_limit() + { + $cache = []; + $pool = new ArrayCachePool(1000, $cache); + + $this->api->setMethodLimits([ + MatchById::class => ['2' => 3], // 3 requests / 10 seconds + ], $pool); + + $result = $this->api->match()->byIds([ + 3152860584, + 3152860584, + 3152860584, + 3152860584, // rate limit is 3 so these calls won't get executed + ]); + + $this->assertCount(3, $result->getResponses()); + $this->assertEquals(3152860584, $result->getData()[0]['gameId']); + $this->assertEquals(3152860584, $result->getData()[1]['gameId']); + $this->assertEquals(3152860584, $result->getData()[2]['gameId']); + } + + /** @test */ + public function rate_limited_matches_with_app_and_method_limits() + { + $cache = []; + $pool = new ArrayCachePool(1000, $cache); + + $this->api->setAppLimits([ + '10' => 100, + ], $pool); + + $this->api->setMethodLimits([ + MatchById::class => ['2' => 3], // 3 requests / 10 seconds + ], $pool); + + $result = $this->api->match()->byIds([ + 3152860584, + 3152860584, + 3152860584, + 3152860584, // rate limit is 3 so these calls won't get executed + ]); + + $this->assertCount(3, $result->getResponses()); + $this->assertEquals(3152860584, $result->getData()[0]['gameId']); + $this->assertEquals(3152860584, $result->getData()[1]['gameId']); + $this->assertEquals(3152860584, $result->getData()[2]['gameId']); + } + + /** @test */ + public function rate_limited_matches_with_method_and_app_limits() + { + $cache = []; + $pool = new ArrayCachePool(1000, $cache); + + $this->api->setAppLimits([ + '10' => 3, + ], $pool); + + $this->api->setMethodLimits([ + MatchById::class => ['10' => 500], + ], $pool); + + $result = $this->api->match()->byIds([ + 3152860584, + 3152860584, + 3152860584, + 3152860584, // rate limit is 3 so these calls won't get executed + ]); + + $this->assertCount(3, $result->getResponses()); + $this->assertEquals(3152860584, $result->getData()[0]['gameId']); + $this->assertEquals(3152860584, $result->getData()[1]['gameId']); + $this->assertEquals(3152860584, $result->getData()[2]['gameId']); + } + + /** @test */ + public function rate_limited_matches_with_limits_and_caching_by_single_request() + { + $cache = []; + $pool = new ArrayCachePool(1000, $cache); + + $this->api->addCache($pool) + ->setAppLimits([ + '10' => 2, + ], $pool) + ->setMethodLimits([ + MatchById::class => ['10' => 500], + ], $pool); + + $this->api->match()->byId(3152860584); + $this->api->match()->byId(3152860584); + $this->api->match()->byId(3152860584); + + $this->assertEquals(1, $this->api->getAppRateLimiter()->get(Region::create('euw'), '10')->get()); + + $this->api->removeCache(); + } + + /** @test */ + public function rate_limited_matches_with_limits_and_caching_by_batch_request_gotcha() + { + $cache = []; + $pool = new ArrayCachePool(1000, $cache); + + $this->api->addCache($pool) + ->setAppLimits([ + '10' => 3, + ], $pool) + ->setMethodLimits([ + MatchById::class => ['10' => 500], + ], $pool); + + $this->api->match()->byIds([3152860584, 3152860584, 3152860584, 3152860584, 3152860584, 3152860584]); + + // See the 'Gotchas' section in README + $this->assertEquals(3, $this->api->getAppRateLimiter()->get(Region::create('euw'), '10')->get()); + + $this->api->removeCache(); + } +} diff --git a/tests/IntegrationAssertionTrait.php b/tests/IntegrationAssertionTrait.php new file mode 100644 index 0000000..a1a3158 --- /dev/null +++ b/tests/IntegrationAssertionTrait.php @@ -0,0 +1,40 @@ +getResponses() as $response) { + $psrResponse = $response->getResponse(); + + $this->assertTrue( + $psrResponse->hasHeader('X-App-Rate-Limit-Count') && $psrResponse->hasHeader('X-Method-Rate-Limit-Count'), + 'Rate limit header(s) are missing.' + ); + + $this->assertNotNull($response->getAppRateLimit(), 'App rate-limit was not parsed correctly.'); + $this->assertNotNull($response->getMethodRateLimit(), 'Method rate-limit was not parsed correctly.'); + + $appLimit = $response->getAppRateLimit(); + $currentLimit = reset($appLimit); + $this->assertGreaterThan( + $previousLimit, $currentLimit, + 'The responses were not sorted in the order that they were passed in to the batch call.' + ); + $previousLimit = $currentLimit; + } + + $this->assertInternalType('array', $result->getData()[0], 'One of the batched results does not conform to the expected class.'); + } +} diff --git a/tests/Unit/RateLimiterTest.php b/tests/Unit/RateLimiterTest.php new file mode 100644 index 0000000..05be86d --- /dev/null +++ b/tests/Unit/RateLimiterTest.php @@ -0,0 +1,79 @@ + 3, // 3 in 2s + '5' => 10, // 10 in 5s + ]; + $pool = new ArrayCachePool(1000); + $limiter = new AppRateLimiter($pool, $limits); + $region = Region::create('euw'); + $endpoint = new DummyEndpoint($region); + + $limiter->hit($endpoint, 1); + $limiter->hit($endpoint, 2); + + try { + $limiter->hit($endpoint, 1); // over the limit + + $this->fail(); + } catch (\Exception $e) { + sleep(2); // next limit should be available now + $this->assertTrue($limiter->hit($endpoint, 2)); + $this->assertEquals(2, $limiter->get($region, '2')->get()); + } + + // 5s limit has not been reset yet + sleep(2); + $this->assertTrue($limiter->hit($endpoint, 2)); + $this->assertEquals(7, $limiter->get($region, '5')->get()); + + // Both limits are reset now + sleep(2); + $this->assertEquals(0, $limiter->get($region, '2')->get()); + $this->assertEquals(0, $limiter->get($region, '5')->get()); + } + + /** @test */ + public function method_rate_limiter_simple_usage() + { + $region = Region::create('euw'); + $endpoint = new DummyEndpoint($region); // 5 requests / 2 seconds + $pool = new ArrayCachePool(10); + $limiter = new MethodRateLimiter($pool, []); + + $limiter->hit($endpoint, 5); + + try { + $limiter->hit($endpoint); + + $this->fail(); + } catch (RateLimitReachedException $e) { + sleep(2); + } + + // The limit has been reset + $this->assertTrue($limiter->hit($endpoint)); + $this->assertEquals(1, $limiter->get($endpoint, '2')->get()); + } +} + +class DummyEndpoint extends BaseEndpoint { + protected $rateLimit = ['2' => 5]; + + protected $urlTemplate = '/dummy/endpoint'; +} diff --git a/tests/Unit/ResponseTest.php b/tests/Unit/ResponseTest.php new file mode 100644 index 0000000..92b61fc --- /dev/null +++ b/tests/Unit/ResponseTest.php @@ -0,0 +1,53 @@ + ['nested' => ['data' => 'value']]], [], 200); + + $this->assertEquals('value', $response['deeply.nested.data']); + } + + /** @test */ + public function response_is_countable() + { + $response = new Result([ + ['data' => []], + ['data' => []], + ]); + + $this->assertEquals(2, count($response)); + } + + /** @test */ + public function batch_response_is_iterable() + { + $response = new BatchResult([ + [ + 'data' => [ + 'key' => 'value1', + ] + ], + [ + 'data' => [ + 'key' => 'value2' + ] + ], + ], []); + + foreach ($response as $item) { + foreach ($item as $key => $value) { + $this->assertEquals('data', $key); + $this->assertStringStartsWith('value', $value['key']); + } + } + } +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..369678c --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,6 @@ +load();