public function getStaticChampions( bool $data_by_key = null, string $locale = 'en_US', string $version = null ): StaticData\StaticChampionListDto
	{
		$result = false;
		try
		{
			// Fetch StaticData from JSON files
			if ($data_by_key)
				$result = DataDragonAPI::getStaticChampionsWithKeys($locale, $version);
			else
				$result = DataDragonAPI::getStaticChampions($locale, $version);

			if (!$result) throw new ServerException("StaticData failed to be loaded.");

			// Create missing data
			$result['keys'] = array_map(function($d) use ($data_by_key) {
				return $data_by_key
					? $d['id']
					: $d['key'];
			}, $result['data']);
			$result['keys'] = array_flip($result['keys']);

			$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 StaticData\StaticChampionListDto($result, $this);
		}
	}
public function getStaticChampions( bool $data_by_key = null, string $locale = 'en_US', string $version = null ): StaticData\StaticChampionListDto
	{
		$result = false;
		try
		{
			// Fetch StaticData from JSON files
			if ($data_by_key)
				$result = DataDragonAPI::getStaticChampionsWithKeys($locale, $version);
			else
				$result = DataDragonAPI::getStaticChampions($locale, $version);

			if (!$result) throw new ServerException("StaticData failed to be loaded.");

			// Create missing data
			$result['keys'] = array_map(function($d) use ($data_by_key) {
				return $data_by_key
					? $d['id']
					: $d['key'];
			}, $result['data']);
			$result['keys'] = array_flip($result['keys']);

			$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 StaticData\StaticChampionListDto($result, $this);
		}
	}
public function getStaticChampions ( bool $ data_by_key = null , string $ locale = 'en_US' , string $ version = null ) : StaticData \ StaticChampionListDto { $ result = false ; try { // Fetch StaticData from JSON files if ( $ data_by_key ) $ result = DataDragonAPI :: getStaticChampionsWithKeys ( $ locale , $ version ) ; else $ result = DataDragonAPI :: getStaticChampions ( $ locale , $ version ) ; if ( ! $ result ) throw new ServerException ( "StaticData failed to be loaded." ) ; // Create missing data $ result [ 'keys' ] = array_map ( function ( $ d ) use ( $ data_by_key ) { return $ data_by_key ? $ d [ 'id' ] : $ d [ 'key' ] ; } , $ result [ 'data' ] ) ; $ result [ 'keys' ] = array_flip ( $ result [ 'keys' ] ) ; $ 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 StaticData \ StaticChampionListDto ( $ result , $ this ) ; } }
Retrieves champion list.

@param bool $data_by_key
@param string $locale
@param string $version

@return StaticData\StaticChampionListDto

@throws RequestException
@throws ServerException
@throws SettingsException
Retrieves champion list .