dolejska-daniel/riot-api

getStaticChampion error

Closed this issue · 1 comments

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);
  1. 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:

  • PHP version: 7.2

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