-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extension test fixes + StaticReforgedRunePathListExtension (#26)
[LeagueAPI] StaticData Reforged runes changes & fixes [LeagueAPI] Test fixes and updates (Extension & StaticData Ref.Rune) [LeagueAPI] Removed deprecated extensions
- Loading branch information
1 parent
205d6d7
commit eb957b2
Showing
10 changed files
with
195 additions
and
161 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
73 changes: 73 additions & 0 deletions
73
src/RiotAPI/Extensions/StaticReforgedRunePathListExtension.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright (C) 2016-2018 Daniel Dolejška | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
namespace RiotAPI\Extensions; | ||
|
||
use RiotAPI\Objects\IApiObject; | ||
use RiotAPI\Objects\IApiObjectExtension; | ||
use RiotAPI\Objects\StaticData\StaticReforgedRuneDto; | ||
use RiotAPI\Objects\StaticData\StaticReforgedRunePathDto; | ||
use RiotAPI\Objects\StaticData\StaticReforgedRunePathList; | ||
use RiotAPI\Objects\StaticData\StaticReforgedRuneSlotDto; | ||
use RiotAPI\RiotAPI; | ||
|
||
|
||
/** | ||
* Class StaticReforgedRunePathListExtension | ||
* | ||
* @package RiotAPI\Extensions | ||
*/ | ||
class StaticReforgedRunePathListExtension implements IApiObjectExtension | ||
{ | ||
/** @var StaticReforgedRunePathList $object */ | ||
protected $object; | ||
|
||
/** @var array $rune_list */ | ||
protected $rune_list = []; | ||
|
||
/** | ||
* StaticReforgedRunePathListExtension constructor. | ||
* | ||
* @param IApiObject|StaticReforgedRunePathList $apiObject | ||
* @param RiotAPI $api | ||
*/ | ||
public function __construct( IApiObject &$apiObject, RiotAPI &$api ) | ||
{ | ||
$this->object = $apiObject; | ||
|
||
/** @var StaticReforgedRunePathDto $path */ | ||
foreach ($this->object as $path) | ||
{ | ||
/** @var StaticReforgedRuneSlotDto $slot */ | ||
foreach ($path as $slot) | ||
{ | ||
/** @var StaticReforgedRuneDto $rune */ | ||
foreach ($slot as $rune) | ||
{ | ||
$this->rune_list[$rune->id] = $rune; | ||
} | ||
} | ||
} | ||
} | ||
|
||
public function getRuneById( int $rune_id ) | ||
{ | ||
return @$this->rune_list[$rune_id]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright (C) 2016-2018 Daniel Dolejška | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
namespace RiotAPI\Objects\StaticData; | ||
|
||
use RiotAPI\Objects\ApiObjectIterable; | ||
|
||
|
||
/** | ||
* Class StaticReforgedRuneList | ||
* This object contains collection of all reforged runes. | ||
* | ||
* @iterable $runes | ||
* | ||
* @package RiotAPI\Objects\StaticData | ||
*/ | ||
class StaticReforgedRuneList extends ApiObjectIterable | ||
{ | ||
/** @var StaticReforgedRuneDto[] $runes */ | ||
public $runes; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/RiotAPI/Objects/StaticData/StaticReforgedRunePathList.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright (C) 2016-2018 Daniel Dolejška | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
namespace RiotAPI\Objects\StaticData; | ||
|
||
use RiotAPI\Objects\ApiObjectIterable; | ||
|
||
|
||
/** | ||
* Class StaticReforgedRunePathList | ||
* This object contains collection of reforged rune paths. | ||
* | ||
* @iterable $paths | ||
* | ||
* @package RiotAPI\Objects\StaticData | ||
*/ | ||
class StaticReforgedRunePathList extends ApiObjectIterable | ||
{ | ||
/** @var StaticReforgedRunePathDto[] $paths */ | ||
public $paths; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.