From b4acc24a2a92b42329476278c1c0702b5d14d152 Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Thu, 15 Aug 2019 20:04:30 +0200 Subject: [PATCH 01/15] - improved endpoint "getUniverseTypesData()"; `dogma_attributes` data added --- app/Mapper/Universe/Type.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Mapper/Universe/Type.php b/app/Mapper/Universe/Type.php index a8ce1e9..0b8d728 100644 --- a/app/Mapper/Universe/Type.php +++ b/app/Mapper/Universe/Type.php @@ -28,6 +28,7 @@ class Type extends mapper\AbstractIterator { 'capacity' => 'capacity', 'portion_size' => 'portionSize', 'mass' => 'mass', - 'graphic_id' => 'graphicId' + 'graphic_id' => 'graphicId', + 'dogma_attributes' => 'dogmaAttributes' ]; } \ No newline at end of file From 82595f2306de56a7b9415498febecf3b7ecf5d9f Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Thu, 15 Aug 2019 20:24:29 +0200 Subject: [PATCH 02/15] - improved endpoint "getUniverseTypesData()"; `dogma_attributes` data added --- app/Mapper/Universe/Type.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/Mapper/Universe/Type.php b/app/Mapper/Universe/Type.php index 0b8d728..2080686 100644 --- a/app/Mapper/Universe/Type.php +++ b/app/Mapper/Universe/Type.php @@ -31,4 +31,20 @@ class Type extends mapper\AbstractIterator { 'graphic_id' => 'graphicId', 'dogma_attributes' => 'dogmaAttributes' ]; + + /** + * map iterator + * @return array + */ + public function getData(){ + + $normalize = function(\Iterator $iterator){ + var_dump($iterator->current()); + return 'abc'; + }; + + self::$map['dogma_attributes'] = $normalize; + + return parent::getData(); + } } \ No newline at end of file From 079533ee1b8ecb1a6a9b597528627304a337e452 Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Thu, 15 Aug 2019 20:38:19 +0200 Subject: [PATCH 03/15] - improved endpoint "getUniverseTypesData()"; `dogma_attributes` data added --- app/Mapper/Universe/Type.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/app/Mapper/Universe/Type.php b/app/Mapper/Universe/Type.php index 2080686..f642689 100644 --- a/app/Mapper/Universe/Type.php +++ b/app/Mapper/Universe/Type.php @@ -29,7 +29,7 @@ class Type extends mapper\AbstractIterator { 'portion_size' => 'portionSize', 'mass' => 'mass', 'graphic_id' => 'graphicId', - 'dogma_attributes' => 'dogmaAttributes' + 'dogma_attributes' => 'dogma_attributes' ]; /** @@ -38,12 +38,18 @@ class Type extends mapper\AbstractIterator { */ public function getData(){ - $normalize = function(\Iterator $iterator){ - var_dump($iterator->current()); - return 'abc'; + $normalizeDogmaAttributes = function(\Iterator $iterator){ + $dogmaAttributes = []; + foreach((array)$iterator->current() as $data){ + $dogmaAttributes[] = [ + 'attributeId' => (int)$data['attribute_id'], + 'value' => (float)$data['value'] + ]; + } + return $dogmaAttributes; }; - self::$map['dogma_attributes'] = $normalize; + self::$map['dogma_attributes'] = $normalizeDogmaAttributes; return parent::getData(); } From bce7ec5c1d0738c3a8914b22f9060dfc815ae45f Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Thu, 15 Aug 2019 20:40:59 +0200 Subject: [PATCH 04/15] - improved endpoint "getUniverseTypesData()"; `dogma_attributes` data added --- app/Mapper/Universe/Type.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Mapper/Universe/Type.php b/app/Mapper/Universe/Type.php index f642689..11d56f4 100644 --- a/app/Mapper/Universe/Type.php +++ b/app/Mapper/Universe/Type.php @@ -42,8 +42,8 @@ public function getData(){ $dogmaAttributes = []; foreach((array)$iterator->current() as $data){ $dogmaAttributes[] = [ - 'attributeId' => (int)$data['attribute_id'], - 'value' => (float)$data['value'] + 'attributeId' => (int)$data->attribute_id, + 'value' => (float)$data->value ]; } return $dogmaAttributes; From 49fd89fcb25e74ef40bed9bdcdc883dd41f42cd6 Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Thu, 15 Aug 2019 22:58:45 +0200 Subject: [PATCH 05/15] - added endpoint "getDogmaAttributeData()" - moved 'Mapper' classes into new folders, grouped by API Client type --- app/Client/ESI.php | 60 ++++++++++++------- app/Client/EsiInterface.php | 6 ++ app/Config/ESIConf.php | 5 ++ app/Mapper/{ => Esi/Alliance}/Alliance.php | 2 +- .../Character/Affiliation.php} | 4 +- app/Mapper/{ => Esi/Character}/Character.php | 2 +- .../{ => Esi/Character}/CharacterClone.php | 2 +- app/Mapper/{ => Esi/Character}/Location.php | 2 +- app/Mapper/{ => Esi/Character}/Online.php | 2 +- app/Mapper/{ => Esi/Character}/Ship.php | 2 +- .../{ => Esi/Corporation}/Corporation.php | 2 +- app/Mapper/Esi/Dogma/Attribute.php | 30 ++++++++++ app/Mapper/{ => Esi}/InventoryType.php | 2 +- app/Mapper/{ => Esi/Search}/Search.php | 2 +- app/Mapper/{EsiStatus.php => Esi/Status.php} | 4 +- .../Status/Status.php} | 4 +- app/Mapper/{ => Esi}/Universe/Category.php | 2 +- .../{ => Esi/Universe}/Constellation.php | 2 +- app/Mapper/{ => Esi}/Universe/Faction.php | 2 +- app/Mapper/{ => Esi}/Universe/Group.php | 2 +- app/Mapper/{ => Esi}/Universe/Planet.php | 2 +- app/Mapper/{ => Esi/Universe}/Region.php | 2 +- app/Mapper/{ => Esi}/Universe/Star.php | 2 +- app/Mapper/{ => Esi}/Universe/Stargate.php | 2 +- app/Mapper/{ => Esi/Universe}/Station.php | 2 +- app/Mapper/{ => Esi}/Universe/Structure.php | 2 +- app/Mapper/{ => Esi/Universe}/System.php | 2 +- app/Mapper/{ => Esi}/Universe/Type.php | 2 +- 28 files changed, 108 insertions(+), 47 deletions(-) rename app/Mapper/{ => Esi/Alliance}/Alliance.php (88%) rename app/Mapper/{CharacterAffiliation.php => Esi/Character/Affiliation.php} (77%) rename app/Mapper/{ => Esi/Character}/Character.php (94%) rename app/Mapper/{ => Esi/Character}/CharacterClone.php (84%) rename app/Mapper/{ => Esi/Character}/Location.php (89%) rename app/Mapper/{ => Esi/Character}/Online.php (94%) rename app/Mapper/{ => Esi/Character}/Ship.php (89%) rename app/Mapper/{ => Esi/Corporation}/Corporation.php (89%) create mode 100644 app/Mapper/Esi/Dogma/Attribute.php rename app/Mapper/{ => Esi}/InventoryType.php (89%) rename app/Mapper/{ => Esi/Search}/Search.php (94%) rename app/Mapper/{EsiStatus.php => Esi/Status.php} (89%) rename app/Mapper/{ServerStatus.php => Esi/Status/Status.php} (80%) rename app/Mapper/{ => Esi}/Universe/Category.php (89%) rename app/Mapper/{ => Esi/Universe}/Constellation.php (91%) rename app/Mapper/{ => Esi}/Universe/Faction.php (92%) rename app/Mapper/{ => Esi}/Universe/Group.php (90%) rename app/Mapper/{ => Esi}/Universe/Planet.php (92%) rename app/Mapper/{ => Esi/Universe}/Region.php (89%) rename app/Mapper/{ => Esi}/Universe/Star.php (92%) rename app/Mapper/{ => Esi}/Universe/Stargate.php (93%) rename app/Mapper/{ => Esi/Universe}/Station.php (87%) rename app/Mapper/{ => Esi}/Universe/Structure.php (92%) rename app/Mapper/{ => Esi/Universe}/System.php (95%) rename app/Mapper/{ => Esi}/Universe/Type.php (97%) diff --git a/app/Client/ESI.php b/app/Client/ESI.php index 247bbcf..4c5c7e7 100644 --- a/app/Client/ESI.php +++ b/app/Client/ESI.php @@ -9,7 +9,7 @@ namespace Exodus4D\ESI\Client; use Exodus4D\ESI\Config; -use Exodus4D\ESI\Mapper; +use Exodus4D\ESI\Mapper\Esi as Mapper; class ESI extends AbstractCcp implements EsiInterface { @@ -74,7 +74,7 @@ public function getServerStatus() : array { $response = $this->request('GET', $uri, $requestOptions)->getContents(); if(!$response->error){ - $serverStatus['status'] = (new Mapper\ServerStatus($response))->getData(); + $serverStatus['status'] = (new Mapper\Status\Status($response))->getData(); }else{ $serverStatus['error'] = $response->error; } @@ -95,7 +95,7 @@ public function getCharacterAffiliationData(array $characterIds) : array { if(!$response->error){ foreach((array)$response as $affiliationData){ - $characterAffiliationData[] = (new Mapper\CharacterAffiliation($affiliationData))->getData(); + $characterAffiliationData[] = (new Mapper\Character\Affiliation($affiliationData))->getData(); } } @@ -114,7 +114,7 @@ public function getCharacterData(int $characterId) : array { $response = $this->request('GET', $uri, $requestOptions)->getContents(); if(!$response->error){ - $characterData = (new Mapper\Character($response))->getData(); + $characterData = (new Mapper\Character\Character($response))->getData(); if( !empty($characterData) ){ $characterData['id'] = $characterId; } @@ -136,7 +136,7 @@ public function getCharacterClonesData(int $characterId, string $accessToken) : $response = $this->request('GET', $uri, $requestOptions)->getContents(); if(!$response->error){ - $clonesData['home'] = (new Mapper\CharacterClone($response->home_location))->getData(); + $clonesData['home'] = (new Mapper\Character\CharacterClone($response->home_location))->getData(); }else{ $clonesData['error'] = $response->error; } @@ -157,7 +157,7 @@ public function getCharacterLocationData(int $characterId, string $accessToken) $response = $this->request('GET', $uri, $requestOptions)->getContents(); if(!$response->error){ - $locationData = (new Mapper\Location($response))->getData(); + $locationData = (new Mapper\Character\Location($response))->getData(); } return $locationData; @@ -176,7 +176,7 @@ public function getCharacterShipData(int $characterId, string $accessToken) : ar $response = $this->request('GET', $uri, $requestOptions)->getContents(); if(!$response->error){ - $shipData = (new Mapper\Ship($response))->getData(); + $shipData = (new Mapper\Character\Ship($response))->getData(); } return $shipData; @@ -195,7 +195,7 @@ public function getCharacterOnlineData(int $characterId, string $accessToken) : $response = $this->request('GET', $uri, $requestOptions)->getContents(); if(!$response->error){ - $onlineData = (new Mapper\Online($response))->getData(); + $onlineData = (new Mapper\Character\Online($response))->getData(); } return $onlineData; @@ -213,7 +213,7 @@ public function getCorporationData(int $corporationId) : array { $response = $this->request('GET', $uri, $requestOptions)->getContents(); if(!$response->error){ - $corporationData = (new Mapper\Corporation($response))->getData(); + $corporationData = (new Mapper\Corporation\Corporation($response))->getData(); if( !empty($corporationData) ){ $corporationData['id'] = $corporationId; } @@ -234,7 +234,7 @@ public function getAllianceData(int $allianceId) : array { $response = $this->request('GET', $uri, $requestOptions)->getContents(); if(!$response->error){ - $allianceData = (new Mapper\Alliance($response))->getData(); + $allianceData = (new Mapper\Alliance\Alliance($response))->getData(); if( !empty($allianceData) ){ $allianceData['id'] = $allianceId; } @@ -337,7 +337,7 @@ public function getUniverseRegionData(int $regionId) : array { $response = $this->request('GET', $uri, $requestOptions)->getContents(); if(!$response->error){ - $regionData = (new Mapper\Region($response))->getData(); + $regionData = (new Mapper\Universe\Region($response))->getData(); } return $regionData; @@ -372,7 +372,7 @@ public function getUniverseConstellationData(int $constellationId) : array { $response = $this->request('GET', $uri, $requestOptions)->getContents(); if(!$response->error){ - $constellationData = (new Mapper\Constellation($response))->getData(); + $constellationData = (new Mapper\Universe\Constellation($response))->getData(); } return $constellationData; @@ -407,7 +407,7 @@ public function getUniverseSystemData(int $systemId) : array { $response = $this->request('GET', $uri, $requestOptions)->getContents(); if(!$response->error){ - $systemData = (new Mapper\System($response))->getData(); + $systemData = (new Mapper\Universe\System($response))->getData(); } return $systemData; @@ -487,20 +487,20 @@ public function getUniverseNamesData(array $universeIds) : array { $category = $data->category; switch($category){ case 'character': - $categoryData = (new Mapper\Character($data))->getData(); + $categoryData = (new Mapper\Character\Character($data))->getData(); break; case 'alliance': - $categoryData = (new Mapper\Alliance($data))->getData(); + $categoryData = (new Mapper\Alliance\Alliance($data))->getData(); break; case 'corporation': - $categoryData = (new Mapper\Corporation($data))->getData(); + $categoryData = (new Mapper\Corporation\Corporation($data))->getData(); break; case 'station': - $categoryData = (new Mapper\Station($data))->getData(); + $categoryData = (new Mapper\Universe\Station($data))->getData(); break; case 'solar_system': $category = 'system'; - $categoryData = (new Mapper\System($data))->getData(); + $categoryData = (new Mapper\Universe\System($data))->getData(); break; case 'inventory_type': $category = 'inventoryType'; @@ -678,6 +678,26 @@ public function getUniverseTypesData(int $typeId) : array { return $typesData; } + /** + * @param int $attributeId + * @return array + */ + public function getDogmaAttributeData(int $attributeId) : array { + $uri = $this->getEndpointURI(['dogma', 'attributes', 'GET'], [$attributeId]); + $attributeData = []; + + $requestOptions = $this->getRequestOptions(); + $response = $this->request('GET', $uri, $requestOptions)->getContents(); + + if($response->error){ + $attributeData['error'] = $response->error; + }else{ + $attributeData = (new Mapper\Dogma\Attribute($response))->getData(); + } + + return $attributeData; + } + /** * @param int $sourceId * @param int $targetId @@ -797,7 +817,7 @@ public function search(array $categories, string $search, bool $strict = false) if($response->error){ $searchData['error'] = $response->error; }else{ - $searchData = (new Mapper\Search($response))->getData(); + $searchData = (new Mapper\Search\Search($response))->getData(); } return $searchData; @@ -821,7 +841,7 @@ public function getStatus(string $version = 'last') : array { if(!$response->error){ foreach((array)$response as $status){ - $statusData['status'][] = (new Mapper\EsiStatus($status))->getData(); + $statusData['status'][] = (new Mapper\Status($status))->getData(); } }else{ $statusData['error'] = $response->error; diff --git a/app/Client/EsiInterface.php b/app/Client/EsiInterface.php index 0303c4f..ccbec76 100644 --- a/app/Client/EsiInterface.php +++ b/app/Client/EsiInterface.php @@ -178,6 +178,12 @@ public function getUniverseStructureData(int $structureId, string $accessToken) */ public function getUniverseTypesData(int $typeId) : array; + /** + * @param int $attributeId + * @return array + */ + public function getDogmaAttributeData(int $attributeId) : array; + /** * @param int $sourceId * @param int $targetId diff --git a/app/Config/ESIConf.php b/app/Config/ESIConf.php index 7f55544..92ec1cc 100644 --- a/app/Config/ESIConf.php +++ b/app/Config/ESIConf.php @@ -53,6 +53,11 @@ class ESIConf extends \Prefab { 'GET' => '/v2/characters/{x}/online/' ] ], + 'dogma' => [ + 'attributes' => [ + 'GET' => '/v1/dogma/attributes/{x}/' + ] + ], 'universe' => [ 'names' => [ 'POST' => '/v3/universe/names/' diff --git a/app/Mapper/Alliance.php b/app/Mapper/Esi/Alliance/Alliance.php similarity index 88% rename from app/Mapper/Alliance.php rename to app/Mapper/Esi/Alliance/Alliance.php index 9cbb5a2..f7f291a 100644 --- a/app/Mapper/Alliance.php +++ b/app/Mapper/Esi/Alliance/Alliance.php @@ -6,7 +6,7 @@ * Time: 00:09 */ -namespace Exodus4D\ESI\Mapper; +namespace Exodus4D\ESI\Mapper\Esi\Alliance; use data\mapper; diff --git a/app/Mapper/CharacterAffiliation.php b/app/Mapper/Esi/Character/Affiliation.php similarity index 77% rename from app/Mapper/CharacterAffiliation.php rename to app/Mapper/Esi/Character/Affiliation.php index 3752daf..3c6b98b 100644 --- a/app/Mapper/CharacterAffiliation.php +++ b/app/Mapper/Esi/Character/Affiliation.php @@ -6,11 +6,11 @@ * Time: 22:00 */ -namespace Exodus4D\ESI\Mapper; +namespace Exodus4D\ESI\Mapper\Esi\Character; use data\mapper; -class CharacterAffiliation extends mapper\AbstractIterator { +class Affiliation extends mapper\AbstractIterator { /** * @var array diff --git a/app/Mapper/Character.php b/app/Mapper/Esi/Character/Character.php similarity index 94% rename from app/Mapper/Character.php rename to app/Mapper/Esi/Character/Character.php index 5c3a661..373d56a 100644 --- a/app/Mapper/Character.php +++ b/app/Mapper/Esi/Character/Character.php @@ -7,7 +7,7 @@ * Time: 19:16 */ -namespace Exodus4D\ESI\Mapper; +namespace Exodus4D\ESI\Mapper\Esi\Character; use data\mapper; diff --git a/app/Mapper/CharacterClone.php b/app/Mapper/Esi/Character/CharacterClone.php similarity index 84% rename from app/Mapper/CharacterClone.php rename to app/Mapper/Esi/Character/CharacterClone.php index a1162f9..778ae29 100644 --- a/app/Mapper/CharacterClone.php +++ b/app/Mapper/Esi/Character/CharacterClone.php @@ -1,7 +1,7 @@ 'id', + 'default_value' => 'defaultValue', + 'description' => 'description', + 'display_name' => 'displayName', + 'high_is_good' => 'highIsGood', + 'icon_id' => 'iconId', + 'name' => 'name', + 'published' => 'published', + 'stackable' => 'stackable', + 'unit_id' => 'unitId' + ]; +} \ No newline at end of file diff --git a/app/Mapper/InventoryType.php b/app/Mapper/Esi/InventoryType.php similarity index 89% rename from app/Mapper/InventoryType.php rename to app/Mapper/Esi/InventoryType.php index c3b329e..c7cebc2 100644 --- a/app/Mapper/InventoryType.php +++ b/app/Mapper/Esi/InventoryType.php @@ -6,7 +6,7 @@ * Time: 11:10 */ -namespace Exodus4D\ESI\Mapper; +namespace Exodus4D\ESI\Mapper\Esi; use data\mapper; diff --git a/app/Mapper/Search.php b/app/Mapper/Esi/Search/Search.php similarity index 94% rename from app/Mapper/Search.php rename to app/Mapper/Esi/Search/Search.php index 93135e8..5d37018 100644 --- a/app/Mapper/Search.php +++ b/app/Mapper/Esi/Search/Search.php @@ -6,7 +6,7 @@ * Time: 15:20 */ -namespace Exodus4D\ESI\Mapper; +namespace Exodus4D\ESI\Mapper\Esi\Search; use data\mapper; diff --git a/app/Mapper/EsiStatus.php b/app/Mapper/Esi/Status.php similarity index 89% rename from app/Mapper/EsiStatus.php rename to app/Mapper/Esi/Status.php index 66451cc..dd48776 100644 --- a/app/Mapper/EsiStatus.php +++ b/app/Mapper/Esi/Status.php @@ -6,11 +6,11 @@ * Time: 00:22 */ -namespace Exodus4D\ESI\Mapper; +namespace Exodus4D\ESI\Mapper\Esi; use data\mapper; -class EsiStatus extends mapper\AbstractIterator { +class Status extends mapper\AbstractIterator { /** * @var array diff --git a/app/Mapper/ServerStatus.php b/app/Mapper/Esi/Status/Status.php similarity index 80% rename from app/Mapper/ServerStatus.php rename to app/Mapper/Esi/Status/Status.php index 000b284..f97a0f4 100644 --- a/app/Mapper/ServerStatus.php +++ b/app/Mapper/Esi/Status/Status.php @@ -6,11 +6,11 @@ * Time: 16:50 */ -namespace Exodus4D\ESI\Mapper; +namespace Exodus4D\ESI\Mapper\Esi\Status; use data\mapper; -class ServerStatus extends mapper\AbstractIterator { +class Status extends mapper\AbstractIterator { /** * @var array diff --git a/app/Mapper/Universe/Category.php b/app/Mapper/Esi/Universe/Category.php similarity index 89% rename from app/Mapper/Universe/Category.php rename to app/Mapper/Esi/Universe/Category.php index 55afbaf..d79dbc8 100644 --- a/app/Mapper/Universe/Category.php +++ b/app/Mapper/Esi/Universe/Category.php @@ -6,7 +6,7 @@ * Time: 00:26 */ -namespace Exodus4D\ESI\Mapper\Universe; +namespace Exodus4D\ESI\Mapper\Esi\Universe; use data\mapper; diff --git a/app/Mapper/Constellation.php b/app/Mapper/Esi/Universe/Constellation.php similarity index 91% rename from app/Mapper/Constellation.php rename to app/Mapper/Esi/Universe/Constellation.php index a47057c..f700a0e 100644 --- a/app/Mapper/Constellation.php +++ b/app/Mapper/Esi/Universe/Constellation.php @@ -6,7 +6,7 @@ * Time: 17:03 */ -namespace Exodus4D\ESI\Mapper; +namespace Exodus4D\ESI\Mapper\Esi\Universe; use data\mapper; diff --git a/app/Mapper/Universe/Faction.php b/app/Mapper/Esi/Universe/Faction.php similarity index 92% rename from app/Mapper/Universe/Faction.php rename to app/Mapper/Esi/Universe/Faction.php index 4b227ed..03180e1 100644 --- a/app/Mapper/Universe/Faction.php +++ b/app/Mapper/Esi/Universe/Faction.php @@ -6,7 +6,7 @@ * Time: 10:57 */ -namespace Exodus4D\ESI\Mapper\Universe; +namespace Exodus4D\ESI\Mapper\Esi\Universe; use data\mapper; diff --git a/app/Mapper/Universe/Group.php b/app/Mapper/Esi/Universe/Group.php similarity index 90% rename from app/Mapper/Universe/Group.php rename to app/Mapper/Esi/Universe/Group.php index a4cb035..17d186d 100644 --- a/app/Mapper/Universe/Group.php +++ b/app/Mapper/Esi/Universe/Group.php @@ -6,7 +6,7 @@ * Time: 02:03 */ -namespace Exodus4D\ESI\Mapper\Universe; +namespace Exodus4D\ESI\Mapper\Esi\Universe; use data\mapper; diff --git a/app/Mapper/Universe/Planet.php b/app/Mapper/Esi/Universe/Planet.php similarity index 92% rename from app/Mapper/Universe/Planet.php rename to app/Mapper/Esi/Universe/Planet.php index 23b69be..63d56e4 100644 --- a/app/Mapper/Universe/Planet.php +++ b/app/Mapper/Esi/Universe/Planet.php @@ -6,7 +6,7 @@ * Time: 01:43 */ -namespace Exodus4D\ESI\Mapper\Universe; +namespace Exodus4D\ESI\Mapper\Esi\Universe; use data\mapper; diff --git a/app/Mapper/Region.php b/app/Mapper/Esi/Universe/Region.php similarity index 89% rename from app/Mapper/Region.php rename to app/Mapper/Esi/Universe/Region.php index 64fc8b5..af97bb3 100644 --- a/app/Mapper/Region.php +++ b/app/Mapper/Esi/Universe/Region.php @@ -6,7 +6,7 @@ * Time: 14:49 */ -namespace Exodus4D\ESI\Mapper; +namespace Exodus4D\ESI\Mapper\Esi\Universe; use data\mapper; diff --git a/app/Mapper/Universe/Star.php b/app/Mapper/Esi/Universe/Star.php similarity index 92% rename from app/Mapper/Universe/Star.php rename to app/Mapper/Esi/Universe/Star.php index 1263f7a..0c2182d 100644 --- a/app/Mapper/Universe/Star.php +++ b/app/Mapper/Esi/Universe/Star.php @@ -6,7 +6,7 @@ * Time: 00:21 */ -namespace Exodus4D\ESI\Mapper\Universe; +namespace Exodus4D\ESI\Mapper\Esi\Universe; use data\mapper; diff --git a/app/Mapper/Universe/Stargate.php b/app/Mapper/Esi/Universe/Stargate.php similarity index 93% rename from app/Mapper/Universe/Stargate.php rename to app/Mapper/Esi/Universe/Stargate.php index 84475e4..ec190f6 100644 --- a/app/Mapper/Universe/Stargate.php +++ b/app/Mapper/Esi/Universe/Stargate.php @@ -6,7 +6,7 @@ * Time: 03:47 */ -namespace Exodus4D\ESI\Mapper\Universe; +namespace Exodus4D\ESI\Mapper\Esi\Universe; use data\mapper; diff --git a/app/Mapper/Station.php b/app/Mapper/Esi/Universe/Station.php similarity index 87% rename from app/Mapper/Station.php rename to app/Mapper/Esi/Universe/Station.php index 255736e..0ed9d88 100644 --- a/app/Mapper/Station.php +++ b/app/Mapper/Esi/Universe/Station.php @@ -6,7 +6,7 @@ * Time: 11:05 */ -namespace Exodus4D\ESI\Mapper; +namespace Exodus4D\ESI\Mapper\Esi\Universe; use data\mapper; diff --git a/app/Mapper/Universe/Structure.php b/app/Mapper/Esi/Universe/Structure.php similarity index 92% rename from app/Mapper/Universe/Structure.php rename to app/Mapper/Esi/Universe/Structure.php index 8f3f483..3649f67 100644 --- a/app/Mapper/Universe/Structure.php +++ b/app/Mapper/Esi/Universe/Structure.php @@ -6,7 +6,7 @@ * Time: 15:40 */ -namespace Exodus4D\ESI\Mapper\Universe; +namespace Exodus4D\ESI\Mapper\Esi\Universe; use data\mapper; diff --git a/app/Mapper/System.php b/app/Mapper/Esi/Universe/System.php similarity index 95% rename from app/Mapper/System.php rename to app/Mapper/Esi/Universe/System.php index aaf87ec..0a11bdc 100644 --- a/app/Mapper/System.php +++ b/app/Mapper/Esi/Universe/System.php @@ -6,7 +6,7 @@ * Time: 11:10 */ -namespace Exodus4D\ESI\Mapper; +namespace Exodus4D\ESI\Mapper\Esi\Universe; use data\mapper; diff --git a/app/Mapper/Universe/Type.php b/app/Mapper/Esi/Universe/Type.php similarity index 97% rename from app/Mapper/Universe/Type.php rename to app/Mapper/Esi/Universe/Type.php index 11d56f4..405ca8d 100644 --- a/app/Mapper/Universe/Type.php +++ b/app/Mapper/Esi/Universe/Type.php @@ -6,7 +6,7 @@ * Time: 15:40 */ -namespace Exodus4D\ESI\Mapper\Universe; +namespace Exodus4D\ESI\Mapper\Esi\Universe; use data\mapper; From 66d6a0d6b9302bb76fa8a83c47962b64d3ee8448 Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Sun, 25 Aug 2019 14:24:12 +0200 Subject: [PATCH 06/15] - added endpoint "getSovereigntyMap()" --- app/Client/ESI.php | 21 +++++++++++++++++++++ app/Client/EsiInterface.php | 5 +++++ app/Config/ESIConf.php | 5 +++++ app/Mapper/Esi/Sovereignty/Map.php | 19 +++++++++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 app/Mapper/Esi/Sovereignty/Map.php diff --git a/app/Client/ESI.php b/app/Client/ESI.php index 4c5c7e7..3511ffd 100644 --- a/app/Client/ESI.php +++ b/app/Client/ESI.php @@ -791,6 +791,27 @@ public function openWindow(int $targetId, string $accessToken) : array { return $return; } + /** + * @return array + */ + public function getSovereigntyMap() : array { + $uri = $this->getEndpointURI(['sovereignty', 'map', 'GET']); + $sovData = []; + + $requestOptions = $this->getRequestOptions(); + $response = $this->request('GET', $uri, $requestOptions)->getContents(); + + if(!$response->error){ + foreach((array)$response as $data){ + $sovData['map'][(int)$data->system_id] = (new Mapper\Sovereignty\Map($data))->getData(); + } + }else{ + $sovData['error'] = $response->error; + } + + return $sovData; + } + /** * @param array $categories * @param string $search diff --git a/app/Client/EsiInterface.php b/app/Client/EsiInterface.php index ccbec76..44df20e 100644 --- a/app/Client/EsiInterface.php +++ b/app/Client/EsiInterface.php @@ -207,6 +207,11 @@ public function setWaypoint(int $systemId, string $accessToken, array $options = */ public function openWindow(int $targetId, string $accessToken) : array; + /** + * @return array + */ + public function getSovereigntyMap() : array; + /** * @param array $categories * @param string $search diff --git a/app/Config/ESIConf.php b/app/Config/ESIConf.php index 92ec1cc..ac47096 100644 --- a/app/Config/ESIConf.php +++ b/app/Config/ESIConf.php @@ -134,6 +134,11 @@ class ESIConf extends \Prefab { ] ] ], + 'sovereignty' => [ + 'map' => [ + 'GET' => '/v1/sovereignty/map/' + ] + ], 'search' => [ 'GET' => '/v2/search/' ] diff --git a/app/Mapper/Esi/Sovereignty/Map.php b/app/Mapper/Esi/Sovereignty/Map.php new file mode 100644 index 0000000..555c812 --- /dev/null +++ b/app/Mapper/Esi/Sovereignty/Map.php @@ -0,0 +1,19 @@ + 'systemId', + 'faction_id' => 'factionId', + 'corporation_id' => 'corporationId', + 'alliance_id' => 'allianceId' + ]; +} \ No newline at end of file From 88bc64d5d518346f7d591ee07c1f488d9653cd63 Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Sun, 25 Aug 2019 17:54:42 +0200 Subject: [PATCH 07/15] - improved endpoint "getAllianceData()"; `date_founded`, `faction_id` data added - improved endpoint "getCorporationData()"; `date_founded`, `faction_id`, `alliance_id` data added --- app/Mapper/Esi/Alliance/Alliance.php | 4 +++- app/Mapper/Esi/Corporation/Corporation.php | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Mapper/Esi/Alliance/Alliance.php b/app/Mapper/Esi/Alliance/Alliance.php index f7f291a..b4ddf72 100644 --- a/app/Mapper/Esi/Alliance/Alliance.php +++ b/app/Mapper/Esi/Alliance/Alliance.php @@ -18,6 +18,8 @@ class Alliance extends mapper\AbstractIterator { protected static $map = [ 'id' => 'id', 'name' => 'name', - 'ticker' => 'ticker' + 'ticker' => 'ticker', + 'date_founded' => 'dateFounded', + 'faction_id' => 'factionId' ]; } \ No newline at end of file diff --git a/app/Mapper/Esi/Corporation/Corporation.php b/app/Mapper/Esi/Corporation/Corporation.php index 279aacb..533ed2d 100644 --- a/app/Mapper/Esi/Corporation/Corporation.php +++ b/app/Mapper/Esi/Corporation/Corporation.php @@ -18,7 +18,10 @@ class Corporation extends mapper\AbstractIterator { protected static $map = [ 'id' => 'id', 'name' => 'name', + 'ticker' => 'ticker', + 'date_founded' => 'dateFounded', 'member_count' => 'memberCount', - 'ticker' => 'ticker' + 'faction_id' => 'factionId', + 'alliance_id' => 'allianceId' ]; } \ No newline at end of file From 36473a824abfa618862fd061d147b92e284582b4 Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Mon, 26 Aug 2019 19:16:06 +0200 Subject: [PATCH 08/15] - improved endpoint "getAllianceData()"; `date_founded`, `faction_id` data added - improved endpoint "getCorporationData()"; `date_founded`, `faction_id`, `alliance_id` data added --- app/Client/ESI.php | 4 ++++ app/Mapper/Esi/Sovereignty/Map.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Client/ESI.php b/app/Client/ESI.php index 3511ffd..c538cd1 100644 --- a/app/Client/ESI.php +++ b/app/Client/ESI.php @@ -217,6 +217,8 @@ public function getCorporationData(int $corporationId) : array { if( !empty($corporationData) ){ $corporationData['id'] = $corporationId; } + }else{ + $corporationData['error'] = $response->error; } return $corporationData; @@ -238,6 +240,8 @@ public function getAllianceData(int $allianceId) : array { if( !empty($allianceData) ){ $allianceData['id'] = $allianceId; } + }else{ + $allianceData['error'] = $response->error; } return $allianceData; diff --git a/app/Mapper/Esi/Sovereignty/Map.php b/app/Mapper/Esi/Sovereignty/Map.php index 555c812..ddb19b5 100644 --- a/app/Mapper/Esi/Sovereignty/Map.php +++ b/app/Mapper/Esi/Sovereignty/Map.php @@ -13,7 +13,7 @@ class Map extends mapper\AbstractIterator { protected static $map = [ 'system_id' => 'systemId', 'faction_id' => 'factionId', - 'corporation_id' => 'corporationId', - 'alliance_id' => 'allianceId' + 'alliance_id' => 'allianceId', + 'corporation_id' => 'corporationId' ]; } \ No newline at end of file From aefe9a4759ce83afec90c0afce391c347daa60e8 Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Mon, 2 Sep 2019 18:53:58 +0200 Subject: [PATCH 09/15] - added endpoint "getFactionWarSystems()" --- app/Client/ESI.php | 21 +++++++++++++++++++ app/Client/EsiInterface.php | 5 +++++ app/Config/ESIConf.php | 5 +++++ app/Mapper/Esi/FactionWarfare/System.php | 26 ++++++++++++++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 app/Mapper/Esi/FactionWarfare/System.php diff --git a/app/Client/ESI.php b/app/Client/ESI.php index c538cd1..fe2cbf5 100644 --- a/app/Client/ESI.php +++ b/app/Client/ESI.php @@ -702,6 +702,27 @@ public function getDogmaAttributeData(int $attributeId) : array { return $attributeData; } + /** + * @return array + */ + public function getFactionWarSystems() : array { + $uri = $this->getEndpointURI(['fw', 'systems', 'GET']); + $systemsData = []; + + $requestOptions = $this->getRequestOptions(); + $response = $this->request('GET', $uri, $requestOptions)->getContents(); + + if($response->error){ + $systemsData['error'] = $response->error; + }else{ + foreach((array)$response as $data){ + $systemsData['systems'][(int)$data->solar_system_id] = (new Mapper\FactionWarfare\System($data))->getData(); + } + } + + return $systemsData; + } + /** * @param int $sourceId * @param int $targetId diff --git a/app/Client/EsiInterface.php b/app/Client/EsiInterface.php index 44df20e..1a78af4 100644 --- a/app/Client/EsiInterface.php +++ b/app/Client/EsiInterface.php @@ -184,6 +184,11 @@ public function getUniverseTypesData(int $typeId) : array; */ public function getDogmaAttributeData(int $attributeId) : array; + /** + * @return array + */ + public function getFactionWarSystems() : array; + /** * @param int $sourceId * @param int $targetId diff --git a/app/Config/ESIConf.php b/app/Config/ESIConf.php index ac47096..415477b 100644 --- a/app/Config/ESIConf.php +++ b/app/Config/ESIConf.php @@ -58,6 +58,11 @@ class ESIConf extends \Prefab { 'GET' => '/v1/dogma/attributes/{x}/' ] ], + 'fw' => [ + 'systems' => [ + 'GET' => '/v2/fw/systems/' + ] + ], 'universe' => [ 'names' => [ 'POST' => '/v3/universe/names/' diff --git a/app/Mapper/Esi/FactionWarfare/System.php b/app/Mapper/Esi/FactionWarfare/System.php new file mode 100644 index 0000000..abc54fc --- /dev/null +++ b/app/Mapper/Esi/FactionWarfare/System.php @@ -0,0 +1,26 @@ + 'id', + 'owner_faction_id' => 'ownerFactionId', + 'occupier_faction_id' => 'occupierFactionId', + 'contested' => 'contested', + 'victory_points' => 'victoryPoints', + 'victory_points_threshold' => 'victoryPointsThreshold' + ]; +} \ No newline at end of file From 312fb085c575f173674076a95437a5ecd950ce21 Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Mon, 2 Sep 2019 19:37:22 +0200 Subject: [PATCH 10/15] - added endpoint "getFactionWarSystems()" --- app/Mapper/Esi/FactionWarfare/System.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Mapper/Esi/FactionWarfare/System.php b/app/Mapper/Esi/FactionWarfare/System.php index abc54fc..9595718 100644 --- a/app/Mapper/Esi/FactionWarfare/System.php +++ b/app/Mapper/Esi/FactionWarfare/System.php @@ -16,7 +16,7 @@ class System extends mapper\AbstractIterator { * @var array */ protected static $map = [ - 'solar_system_id' => 'id', + 'solar_system_id' => 'systemId', 'owner_faction_id' => 'ownerFactionId', 'occupier_faction_id' => 'occupierFactionId', 'contested' => 'contested', From 591f3060cae5512b16a5df5e7ac50aa6d788974a Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Sun, 22 Sep 2019 02:17:36 +0200 Subject: [PATCH 11/15] - added endpoint "getUniverseRaces()" - added endpoint "getUniverseRaceData()" - added endpoint "getUniverseStationData()" --- app/Client/ESI.php | 65 +++++++++++++++++++++++++++-- app/Client/EsiInterface.php | 28 +++++++++++++ app/Config/ESIConf.php | 8 ++++ app/Mapper/Esi/Universe/Race.php | 19 +++++++++ app/Mapper/Esi/Universe/Station.php | 12 +++++- 5 files changed, 128 insertions(+), 4 deletions(-) create mode 100644 app/Mapper/Esi/Universe/Race.php diff --git a/app/Client/ESI.php b/app/Client/ESI.php index fe2cbf5..084216a 100644 --- a/app/Client/ESI.php +++ b/app/Client/ESI.php @@ -284,12 +284,13 @@ public function getUniverseFactions() : array { $requestOptions = $this->getRequestOptions(); $response = $this->request('GET', $uri, $requestOptions)->getContents(); - if(!$response->error){ + if($response->error){ + $factionData['error'] = $response->error; + + }else{ foreach((array)$response as $data){ $factionData['factions'][(int)$data->faction_id] = (new Mapper\Universe\Faction($data))->getData(); } - }else{ - $factionData['error'] = $response->error; } return $factionData; @@ -312,6 +313,44 @@ public function getUniverseFactionData(int $factionId) : array { return $factionData; } + /** + * @return array + */ + public function getUniverseRaces() : array { + $uri = $this->getEndpointURI(['universe', 'races', 'list', 'GET']); + $raceData = []; + + $requestOptions = $this->getRequestOptions(); + $response = $this->request('GET', $uri, $requestOptions)->getContents(); + + if($response->error){ + $raceData['error'] = $response->error; + }else{ + foreach((array)$response as $data){ + $raceData['races'][(int)$data->race_id] = (new Mapper\Universe\Race($data))->getData(); + } + } + + return $raceData; + } + + /** + * @param int $raceId + * @return array + */ + public function getUniverseRaceData(int $raceId) : array { + $raceDataAll = $this->getUniverseRaces(); + $raceData = []; + + if(isset($raceDataAll['error'])){ + $raceData = $raceDataAll; + }elseif(is_array($raceDataAll['races']) && array_key_exists($raceId, $raceDataAll['races'])){ + $raceData = $raceDataAll['races'][$raceId]; + } + + return $raceData; + } + /** * @return array */ @@ -664,6 +703,26 @@ public function getUniverseStructureData(int $structureId, string $accessToken) return $structureData; } + /** + * @param int $stationId + * @return array + */ + public function getUniverseStationData(int $stationId) : array { + $uri = $this->getEndpointURI(['universe', 'stations', 'GET'], [$stationId]); + $stationData = []; + + $requestOptions = $this->getRequestOptions(); + $response = $this->request('GET', $uri, $requestOptions)->getContents(); + + if($response->error){ + $stationData['error'] = $response->error; + }else{ + $stationData = (new Mapper\Universe\Station($response))->getData(); + } + + return $stationData; + } + /** * @param int $typeId * @return array diff --git a/app/Client/EsiInterface.php b/app/Client/EsiInterface.php index 1a78af4..6f268bf 100644 --- a/app/Client/EsiInterface.php +++ b/app/Client/EsiInterface.php @@ -76,6 +76,28 @@ public function getAllianceData(int $allianceId) : array; */ public function getCorporationRoles(int $corporationId, string $accessToken) : array; + /** + * @return array + */ + public function getUniverseFactions() : array; + + /** + * @param int $factionId + * @return array + */ + public function getUniverseFactionData(int $factionId) : array; + + /** + * @return array + */ + public function getUniverseRaces() : array; + + /** + * @param int $raceId + * @return array + */ + public function getUniverseRaceData(int $raceId) : array; + /** * @return array */ @@ -172,6 +194,12 @@ public function getUniverseGroupData(int $groupId) : array; */ public function getUniverseStructureData(int $structureId, string $accessToken) : array; + /** + * @param int $stationId + * @return array + */ + public function getUniverseStationData(int $stationId) : array; + /** * @param int $typeId * @return array diff --git a/app/Config/ESIConf.php b/app/Config/ESIConf.php index 415477b..bb8bf4c 100644 --- a/app/Config/ESIConf.php +++ b/app/Config/ESIConf.php @@ -78,6 +78,11 @@ class ESIConf extends \Prefab { 'system_kills' => [ 'GET' => '/v2/universe/system_kills/' ], + 'races' => [ + 'list' => [ + 'GET' => '/v1/universe/races/' + ] + ], 'regions' => [ 'GET' => '/v1/universe/regions/{x}/', 'list' => [ @@ -105,6 +110,9 @@ class ESIConf extends \Prefab { 'stargates' => [ 'GET' => '/v1/universe/stargates/{x}/' ], + 'stations' => [ + 'GET' => '/v2/universe/stations/{x}/' + ], 'structures' => [ 'GET' => '/v2/universe/structures/{x}/' ], diff --git a/app/Mapper/Esi/Universe/Race.php b/app/Mapper/Esi/Universe/Race.php new file mode 100644 index 0000000..7e52d3d --- /dev/null +++ b/app/Mapper/Esi/Universe/Race.php @@ -0,0 +1,19 @@ + 'id', + 'name' => 'name', + 'description' => 'description', + 'alliance_id' => 'allianceId' + ]; +} \ No newline at end of file diff --git a/app/Mapper/Esi/Universe/Station.php b/app/Mapper/Esi/Universe/Station.php index 0ed9d88..59836a5 100644 --- a/app/Mapper/Esi/Universe/Station.php +++ b/app/Mapper/Esi/Universe/Station.php @@ -17,6 +17,16 @@ class Station extends mapper\AbstractIterator { */ protected static $map = [ 'id' => 'id', - 'name' => 'name' + 'station_id' => 'id', + 'name' => 'name', + 'system_id' => 'systemId', + 'type_id' => 'typeId', + 'race_id' => 'raceId', + 'owner' => 'ownerId', + 'services' => 'services', + 'position' => 'position', + 'x' => 'x', + 'y' => 'y', + 'z' => 'z' ]; } \ No newline at end of file From 79cf26b94278c579dde2ac860c3625b45940afa6 Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Sun, 22 Sep 2019 02:53:01 +0200 Subject: [PATCH 12/15] - improved endpoint "getUniverseSystemData()"; `stations` data added --- app/Mapper/Esi/Universe/System.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Mapper/Esi/Universe/System.php b/app/Mapper/Esi/Universe/System.php index 0a11bdc..ed779f3 100644 --- a/app/Mapper/Esi/Universe/System.php +++ b/app/Mapper/Esi/Universe/System.php @@ -28,6 +28,7 @@ class System extends mapper\AbstractIterator { 'moons' => 'moons', 'asteroid_belts' => 'asteroidBelts', 'stargates' => 'stargates', + 'stations' => 'stations', 'position' => 'position', 'x' => 'x', 'y' => 'y', From a6e4756d68c89158b148bf1c4540b70cfde414d0 Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Sun, 22 Sep 2019 05:33:11 +0200 Subject: [PATCH 13/15] - improved endpoint "getUniverseSystemData()"; `stations` data added --- app/Client/ESI.php | 5 +++-- app/Mapper/Esi/Universe/Station.php | 2 +- app/Mapper/Esi/Universe/Structure.php | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Client/ESI.php b/app/Client/ESI.php index 084216a..c3eb050 100644 --- a/app/Client/ESI.php +++ b/app/Client/ESI.php @@ -286,7 +286,6 @@ public function getUniverseFactions() : array { if($response->error){ $factionData['error'] = $response->error; - }else{ foreach((array)$response as $data){ $factionData['factions'][(int)$data->faction_id] = (new Mapper\Universe\Faction($data))->getData(); @@ -693,7 +692,9 @@ public function getUniverseStructureData(int $structureId, string $accessToken) $requestOptions = $this->getRequestOptions($accessToken); $response = $this->request('GET', $uri, $requestOptions)->getContents(); - if(!$response->error){ + if($response->error){ + $structureData['error'] = $response->error; + }else{ $structureData = (new Mapper\Universe\Structure($response))->getData(); if( !empty($structureData) ){ $structureData['id'] = $structureId; diff --git a/app/Mapper/Esi/Universe/Station.php b/app/Mapper/Esi/Universe/Station.php index 59836a5..2a42fbe 100644 --- a/app/Mapper/Esi/Universe/Station.php +++ b/app/Mapper/Esi/Universe/Station.php @@ -21,8 +21,8 @@ class Station extends mapper\AbstractIterator { 'name' => 'name', 'system_id' => 'systemId', 'type_id' => 'typeId', + 'owner' => 'corporationId', 'race_id' => 'raceId', - 'owner' => 'ownerId', 'services' => 'services', 'position' => 'position', 'x' => 'x', diff --git a/app/Mapper/Esi/Universe/Structure.php b/app/Mapper/Esi/Universe/Structure.php index 3649f67..b7cb727 100644 --- a/app/Mapper/Esi/Universe/Structure.php +++ b/app/Mapper/Esi/Universe/Structure.php @@ -19,7 +19,7 @@ class Structure extends mapper\AbstractIterator { 'name' => 'name', 'solar_system_id' => 'systemId', 'type_id' => 'typeId', - 'owner_id' => 'ownerId', + 'owner_id' => 'corporationId', 'position' => 'position', 'x' => 'x', 'y' => 'y', From 055938e21f12b6fe19c0d2e39c05bec0b099d609 Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Sun, 22 Sep 2019 14:26:39 +0200 Subject: [PATCH 14/15] - improved endpoint "getUniverseSystemData()"; `stations` data added --- app/Mapper/Esi/Universe/Race.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Mapper/Esi/Universe/Race.php b/app/Mapper/Esi/Universe/Race.php index 7e52d3d..f20310d 100644 --- a/app/Mapper/Esi/Universe/Race.php +++ b/app/Mapper/Esi/Universe/Race.php @@ -14,6 +14,6 @@ class Race extends mapper\AbstractIterator { 'race_id' => 'id', 'name' => 'name', 'description' => 'description', - 'alliance_id' => 'allianceId' + 'alliance_id' => 'factionId' // CCP failed here... ]; } \ No newline at end of file From cb5ace26794c55770d5ae4428a8a4dadc006939c Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Mon, 30 Sep 2019 19:37:43 +0200 Subject: [PATCH 15/15] - improved endpoint "setWaypoint()" --- app/Client/ESI.php | 8 ++++---- app/Client/EsiInterface.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Client/ESI.php b/app/Client/ESI.php index c3eb050..64c9468 100644 --- a/app/Client/ESI.php +++ b/app/Client/ESI.php @@ -826,26 +826,26 @@ public function getRouteData(int $sourceId, int $targetId, array $options = []) } /** - * @param int $systemId + * @param int $destinationId * @param string $accessToken * @param array $options * @return array */ - public function setWaypoint(int $systemId, string $accessToken, array $options = []) : array { + public function setWaypoint(int $destinationId, string $accessToken, array $options = []) : array { $uri = $this->getEndpointURI(['ui', 'autopilot', 'waypoint', 'POST']); $waypointData = []; $query = [ 'add_to_beginning' => var_export( (bool)$options['addToBeginning'], true), 'clear_other_waypoints' => var_export( (bool)$options['clearOtherWaypoints'], true), - 'destination_id' => $systemId + 'destination_id' => $destinationId ]; $requestOptions = $this->getRequestOptions($accessToken, null, $query); $response = $this->request('POST', $uri, $requestOptions)->getContents(); // "null" === success => There is no response body send... - if( $response->error ){ + if($response->error){ $waypointData['error'] = self::ERROR_ESI_WAYPOINT; } diff --git a/app/Client/EsiInterface.php b/app/Client/EsiInterface.php index 6f268bf..8f35888 100644 --- a/app/Client/EsiInterface.php +++ b/app/Client/EsiInterface.php @@ -226,12 +226,12 @@ public function getFactionWarSystems() : array; public function getRouteData(int $sourceId, int $targetId, array $options = []) : array; /** - * @param int $systemId + * @param int $destinationId * @param string $accessToken * @param array $options * @return array */ - public function setWaypoint(int $systemId, string $accessToken, array $options = []) : array; + public function setWaypoint(int $destinationId, string $accessToken, array $options = []) : array; /** * @param int $targetId