dolejska-daniel / riot-api

Riot League of Legends & DataDragon API wrappers for PHP7 and PHP8.
GNU General Public License v3.0
112 stars 25 forks source link

getStaticChampion error #54

Closed IgorsKolcins closed 5 years ago

IgorsKolcins commented 5 years ago

Describe the bug When I try to get static champion data error occurs.

To Reproduce Steps to reproduce the behavior:

  1. Run this code:

    $api = new LeagueAPI([
    LeagueAPI::SET_KEY => 'MY_KEY',
    LeagueAPI::SET_REGION => Region::EUROPE_EAST,
    ]);
    $api->getStaticChampion(61);
  2. See error: Argument 1 passed to RiotAPI\LeagueAPI\Objects\ApiObject::__construct() must be of the type array, boolean given, called in /var/www/thekingeagle/public/vendor/dolejska-daniel/riot-api/src/LeagueAPI/LeagueAPI.php on line 1809

Server:

IgorsKolcins commented 5 years ago

Well, I found a problem. This was a permission issue on my server. You must give write permission for the folder ./vendor/dolejska-daniel/riot-api/src/DataDragonAPI because the cache folder cannot be created (or create cache folder and give write permissions for cache folder). The error was in this file: RiotAPI\DataDragonAPI\DataDragonAPI::saveSataicData