Closed dolejska-daniel closed 4 years ago
DataDragonAPI calls template:
$result = false; try { // Fetch StaticData from JSON files $result = DataDragonAPI::FUNCTION_NAME(...$PARAMETERS); if (!$result) throw new ServerException("StaticData failed to be loaded."); $this->result_data = $result; } catch (DataDragonExceptions\SettingsException $ex) { throw new SettingsException("DataDragon API was not initialized properly! StaticData endpoints cannot be used."); } catch (DataDragonExceptions\ArgumentException $ex) { throw new RequestException($ex->getMessage(), $ex->getCode()); } finally { // Parse array and create instances return new ApiObject($result, $this); }
Should be refactored to "kind of" match up with normal API calls:
$this->setEndpoint("/lol/league/" . self::RESOURCE_LEAGUE_VERSION . "/grandmasterleagues/by-queue/{$game_queue_type}") ->setResource(self::RESOURCE_LEAGUE, "/grandmasterleagues/by-queue/%s") ->makeCall(); return new Objects\LeagueListDto($this->getResult(), $this);
DataDragonAPI calls template:
Should be refactored to "kind of" match up with normal API calls: