dolejska-daniel / riot-api

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

Cannot even start #72

Closed ghost closed 4 years ago

ghost commented 4 years ago

I've imported it with the composer. Setup the key but the example report this error:

Fatal error: Uncaught RiotAPI\LeagueAPI\Exceptions\SettingsException: DataDragon API was not initialized properly! StaticData endpoints cannot be used. in /home/xxxxx.cloudwaysapps.com/zwejmghdjb/public_html/riot/vendor/dolejska-daniel/riot-api/src/LeagueAPI/LeagueAPI.php:1986 Stack trace: #0 /home/xxxx.cloudwaysapps.com/zwejmghdjb/public_html/riot/_importer_item.php(36): RiotAPI\LeagueAPI\LeagueAPI->getStaticChampion() #1 {main} Next TypeError: Argument 1 passed to RiotAPI\LeagueAPI\Objects\ApiObject::__construct() must be of the type array, bool given, called in /home/xxxxx.cloudwaysapps.com/zwejmghdjb/public_html/riot/vendor/dolejska-daniel/riot-api/src/LeagueAPI/LeagueAPI.php on line 1995 and defined in /home/xxx.cloudwaysapps.com/zwejmghdjb/public_html/riot/vendor/dolejska-daniel/riot-api/src/LeagueAPI/Objects/ApiObject.php:47 Stack trace: #0 /home/xxxxx.cloudwaysapps.com/zwejmghdjb/public_html/riot/vendor/dolejska-daniel/riot-api/src/LeagueAPI/LeagueAPI.php(1995): RiotAPI\LeagueAPI\Objects\ApiObject->__cons in /home/xxxxx.cloudwaysapps.com/zwejmghdjb/public_html/riot/vendor/dolejska-daniel/riot-api/src/LeagueAPI/Objects/ApiObject.php on line 47

can you help me understanding where i'm doing error?

dolejska-daniel commented 4 years ago

Hello, thank you for the interest in this library ☺️ To use StaticData endpoints you first have to initialize DataDragonAPI or allow it's initialization - please see wiki pages for more information.