@@ -10,12 +10,12 @@ discard block  | 
                                                    ||
| 10 | 10 |  { | 
                                                        
| 11 | 11 | private $request;  | 
                                                        
| 12 | 12 | |
| 13 | - public function __construct(Request $request)  | 
                                                        |
| 13 | + public function __construct (Request $request)  | 
                                                        |
| 14 | 14 |      { | 
                                                        
| 15 | 15 | $this->request = $request;  | 
                                                        
| 16 | 16 | }  | 
                                                        
| 17 | 17 | |
| 18 | - public function retrieve($objectId)  | 
                                                        |
| 18 | + public function retrieve ($objectId)  | 
                                                        |
| 19 | 19 |      { | 
                                                        
| 20 | 20 |          $responseArray = $this->request->get("rates/$objectId"); | 
                                                        
| 21 | 21 | |
@@ -26,7 +26,7 @@ discard block  | 
                                                    ||
| 26 | 26 | * @param null|int $results  | 
                                                        
| 27 | 27 | * @return RateList  | 
                                                        
| 28 | 28 | */  | 
                                                        
| 29 | - public function getList($results = null)  | 
                                                        |
| 29 | + public function getList ($results = null)  | 
                                                        |
| 30 | 30 |      { | 
                                                        
| 31 | 31 |          $responseArray = $this->request->get("rates", ['results' => $results]); | 
                                                        
| 32 | 32 | |
@@ -11,12 +11,12 @@ discard block  | 
                                                    ||
| 11 | 11 |  { | 
                                                        
| 12 | 12 | private $request;  | 
                                                        
| 13 | 13 | |
| 14 | - public function __construct(Request $request)  | 
                                                        |
| 14 | + public function __construct (Request $request)  | 
                                                        |
| 15 | 15 |      { | 
                                                        
| 16 | 16 | $this->request = $request;  | 
                                                        
| 17 | 17 | }  | 
                                                        
| 18 | 18 | |
| 19 | - public function purchase($rateObjectId)  | 
                                                        |
| 19 | + public function purchase ($rateObjectId)  | 
                                                        |
| 20 | 20 |      { | 
                                                        
| 21 | 21 | $createObject = new CreateObject(['rate' => $rateObjectId]);  | 
                                                        
| 22 | 22 |          $responseArray = $this->request->post("transactions", $createObject->toArray()); | 
                                                        
@@ -24,7 +24,7 @@ discard block  | 
                                                    ||
| 24 | 24 | return new Transaction($responseArray);  | 
                                                        
| 25 | 25 | }  | 
                                                        
| 26 | 26 | |
| 27 | - public function retrieve($objectId)  | 
                                                        |
| 27 | + public function retrieve ($objectId)  | 
                                                        |
| 28 | 28 |      { | 
                                                        
| 29 | 29 |          $responseArray = $this->request->get("transactions/$objectId"); | 
                                                        
| 30 | 30 | |
@@ -35,7 +35,7 @@ discard block  | 
                                                    ||
| 35 | 35 | * @param null|int $results  | 
                                                        
| 36 | 36 | * @return TransactionList  | 
                                                        
| 37 | 37 | */  | 
                                                        
| 38 | - public function getList($results = null)  | 
                                                        |
| 38 | + public function getList ($results = null)  | 
                                                        |
| 39 | 39 |      { | 
                                                        
| 40 | 40 |          $responseArray = $this->request->get("transactions", ['results' => $results]); | 
                                                        
| 41 | 41 | |
@@ -13,12 +13,12 @@ discard block  | 
                                                    ||
| 13 | 13 |  { | 
                                                        
| 14 | 14 | private $request;  | 
                                                        
| 15 | 15 | |
| 16 | - public function __construct(Request $request)  | 
                                                        |
| 16 | + public function __construct (Request $request)  | 
                                                        |
| 17 | 17 |      { | 
                                                        
| 18 | 18 | $this->request = $request;  | 
                                                        
| 19 | 19 | }  | 
                                                        
| 20 | 20 | |
| 21 | - public function create(array $attributes)  | 
                                                        |
| 21 | + public function create (array $attributes)  | 
                                                        |
| 22 | 22 |      { | 
                                                        
| 23 | 23 | $createObj = new CreateObject($attributes);  | 
                                                        
| 24 | 24 |          $responseArray = $this->request->post('shipments', $createObj->toArray()); | 
                                                        
@@ -26,7 +26,7 @@ discard block  | 
                                                    ||
| 26 | 26 | return new Shipment($responseArray);  | 
                                                        
| 27 | 27 | }  | 
                                                        
| 28 | 28 | |
| 29 | - public function createByNestedCall(array $attributes)  | 
                                                        |
| 29 | + public function createByNestedCall (array $attributes)  | 
                                                        |
| 30 | 30 |      { | 
                                                        
| 31 | 31 | $createObj = new CreateObjectByNested($attributes);  | 
                                                        
| 32 | 32 |          $responseArray = $this->request->postWithJsonBody('shipments', $createObj->toArray()); | 
                                                        
@@ -34,12 +34,12 @@ discard block  | 
                                                    ||
| 34 | 34 | return new Shipment($responseArray);  | 
                                                        
| 35 | 35 | }  | 
                                                        
| 36 | 36 | |
| 37 | - public function createReturn()  | 
                                                        |
| 37 | + public function createReturn ()  | 
                                                        |
| 38 | 38 |      { | 
                                                        
| 39 | 39 | // TODO  | 
                                                        
| 40 | 40 | }  | 
                                                        
| 41 | 41 | |
| 42 | - public function retrieve($objectId)  | 
                                                        |
| 42 | + public function retrieve ($objectId)  | 
                                                        |
| 43 | 43 |      { | 
                                                        
| 44 | 44 |          $responseArray = $this->request->get("shipments/$objectId"); | 
                                                        
| 45 | 45 | |
@@ -50,14 +50,14 @@ discard block  | 
                                                    ||
| 50 | 50 | * @param null|int $results  | 
                                                        
| 51 | 51 | * @return ShipmentList  | 
                                                        
| 52 | 52 | */  | 
                                                        
| 53 | - public function getList($results = null)  | 
                                                        |
| 53 | + public function getList ($results = null)  | 
                                                        |
| 54 | 54 |      { | 
                                                        
| 55 | 55 |          $responseArray = $this->request->get("shipments", ['results' => $results]); | 
                                                        
| 56 | 56 | |
| 57 | 57 | return new ShipmentList($responseArray);  | 
                                                        
| 58 | 58 | }  | 
                                                        
| 59 | 59 | |
| 60 | - public function getRateList($objectId, $currencyCode = '')  | 
                                                        |
| 60 | + public function getRateList ($objectId, $currencyCode = '')  | 
                                                        |
| 61 | 61 |      { | 
                                                        
| 62 | 62 |          $responseArray = $this->request->get("shipments/$objectId/rates/$currencyCode"); | 
                                                        
| 63 | 63 | |
@@ -11,12 +11,12 @@ discard block  | 
                                                    ||
| 11 | 11 |  { | 
                                                        
| 12 | 12 | private $request;  | 
                                                        
| 13 | 13 | |
| 14 | - public function __construct(Request $request)  | 
                                                        |
| 14 | + public function __construct (Request $request)  | 
                                                        |
| 15 | 15 |      { | 
                                                        
| 16 | 16 | $this->request = $request;  | 
                                                        
| 17 | 17 | }  | 
                                                        
| 18 | 18 | |
| 19 | - public function create(array $attributes)  | 
                                                        |
| 19 | + public function create (array $attributes)  | 
                                                        |
| 20 | 20 |      { | 
                                                        
| 21 | 21 | $createObj = new CreateObject($attributes);  | 
                                                        
| 22 | 22 |          $responseArray = $this->request->post('parcels', $createObj->toArray()); | 
                                                        
@@ -24,7 +24,7 @@ discard block  | 
                                                    ||
| 24 | 24 | return new Parcel($responseArray);  | 
                                                        
| 25 | 25 | }  | 
                                                        
| 26 | 26 | |
| 27 | - public function retrieve($objectId)  | 
                                                        |
| 27 | + public function retrieve ($objectId)  | 
                                                        |
| 28 | 28 |      { | 
                                                        
| 29 | 29 |          $responseArray = $this->request->get("parcels/$objectId"); | 
                                                        
| 30 | 30 | |
@@ -35,7 +35,7 @@ discard block  | 
                                                    ||
| 35 | 35 | * @param null|int $results  | 
                                                        
| 36 | 36 | * @return ParcelList  | 
                                                        
| 37 | 37 | */  | 
                                                        
| 38 | - public function getList($results = null)  | 
                                                        |
| 38 | + public function getList ($results = null)  | 
                                                        |
| 39 | 39 |      { | 
                                                        
| 40 | 40 |          $responseArray = $this->request->get("parcels", ['results' => $results]); | 
                                                        
| 41 | 41 | |
@@ -10,19 +10,19 @@ discard block  | 
                                                    ||
| 10 | 10 |  { | 
                                                        
| 11 | 11 | private $request;  | 
                                                        
| 12 | 12 | |
| 13 | - public function __construct(Request $request)  | 
                                                        |
| 13 | + public function __construct (Request $request)  | 
                                                        |
| 14 | 14 |      { | 
                                                        
| 15 | 15 | $this->request = $request;  | 
                                                        
| 16 | 16 | }  | 
                                                        
| 17 | 17 | |
| 18 | - public function create($transactionObjectId)  | 
                                                        |
| 18 | + public function create ($transactionObjectId)  | 
                                                        |
| 19 | 19 |      { | 
                                                        
| 20 | 20 |          $responseArray = $this->request->post('refunds', ['transaction' => $transactionObjectId]); | 
                                                        
| 21 | 21 | |
| 22 | 22 | return new Refund($responseArray);  | 
                                                        
| 23 | 23 | }  | 
                                                        
| 24 | 24 | |
| 25 | - public function retrieve($objectId)  | 
                                                        |
| 25 | + public function retrieve ($objectId)  | 
                                                        |
| 26 | 26 |      { | 
                                                        
| 27 | 27 |          $responseArray = $this->request->get("refunds/$objectId"); | 
                                                        
| 28 | 28 | |
@@ -33,7 +33,7 @@ discard block  | 
                                                    ||
| 33 | 33 | * @param null|int $results  | 
                                                        
| 34 | 34 | * @return RefundList  | 
                                                        
| 35 | 35 | */  | 
                                                        
| 36 | - public function getList($results = null)  | 
                                                        |
| 36 | + public function getList ($results = null)  | 
                                                        |
| 37 | 37 |      { | 
                                                        
| 38 | 38 |          $responseArray = $this->request->get("refunds", ['results' => $results]); | 
                                                        
| 39 | 39 | |
@@ -11,12 +11,12 @@ discard block  | 
                                                    ||
| 11 | 11 |  { | 
                                                        
| 12 | 12 | private $request;  | 
                                                        
| 13 | 13 | |
| 14 | - public function __construct(Request $request)  | 
                                                        |
| 14 | + public function __construct (Request $request)  | 
                                                        |
| 15 | 15 |      { | 
                                                        
| 16 | 16 | $this->request = $request;  | 
                                                        
| 17 | 17 | }  | 
                                                        
| 18 | 18 | |
| 19 | - public function create(array $attributes)  | 
                                                        |
| 19 | + public function create (array $attributes)  | 
                                                        |
| 20 | 20 |      { | 
                                                        
| 21 | 21 | $createObj = new CreateObject($attributes);  | 
                                                        
| 22 | 22 |          $responseArray = $this->request->post('addresses', $createObj->toArray()); | 
                                                        
@@ -24,14 +24,14 @@ discard block  | 
                                                    ||
| 24 | 24 | return new Address($responseArray);  | 
                                                        
| 25 | 25 | }  | 
                                                        
| 26 | 26 | |
| 27 | - public function retrieve($objectId)  | 
                                                        |
| 27 | + public function retrieve ($objectId)  | 
                                                        |
| 28 | 28 |      { | 
                                                        
| 29 | 29 |          $responseArray = $this->request->get("addresses/$objectId"); | 
                                                        
| 30 | 30 | |
| 31 | 31 | return new Address($responseArray);  | 
                                                        
| 32 | 32 | }  | 
                                                        
| 33 | 33 | |
| 34 | - public function validate($objectId)  | 
                                                        |
| 34 | + public function validate ($objectId)  | 
                                                        |
| 35 | 35 |      { | 
                                                        
| 36 | 36 |          $responseArray = $this->request->get("addresses/$objectId/validate"); | 
                                                        
| 37 | 37 | |
@@ -42,7 +42,7 @@ discard block  | 
                                                    ||
| 42 | 42 | * @param null|int $results  | 
                                                        
| 43 | 43 | * @return AddressList  | 
                                                        
| 44 | 44 | */  | 
                                                        
| 45 | - public function getList($results = null)  | 
                                                        |
| 45 | + public function getList ($results = null)  | 
                                                        |
| 46 | 46 |      { | 
                                                        
| 47 | 47 |          $responseArray = $this->request->get("addresses", ['results' => $results]); | 
                                                        
| 48 | 48 | |
@@ -16,7 +16,7 @@ discard block  | 
                                                    ||
| 16 | 16 | private $delegated;  | 
                                                        
| 17 | 17 | private $mockContainer;  | 
                                                        
| 18 | 18 | |
| 19 | - public function __construct($accessToken)  | 
                                                        |
| 19 | + public function __construct ($accessToken)  | 
                                                        |
| 20 | 20 |      { | 
                                                        
| 21 | 21 | $this->delegated = new Client(static::BASE_URI, [  | 
                                                        
| 22 | 22 | 'request.options' => [  | 
                                                        
@@ -26,7 +26,7 @@ discard block  | 
                                                    ||
| 26 | 26 | $this->mockContainer = MockCollection::getInstance();  | 
                                                        
| 27 | 27 | }  | 
                                                        
| 28 | 28 | |
| 29 | - public function post($endPoint, $body = [])  | 
                                                        |
| 29 | + public function post ($endPoint, $body = [])  | 
                                                        |
| 30 | 30 |      { | 
                                                        
| 31 | 31 | $this->mockFilter($endPoint);  | 
                                                        
| 32 | 32 | $request = $this->delegated->post($endPoint, null, $body);  | 
                                                        
@@ -35,7 +35,7 @@ discard block  | 
                                                    ||
| 35 | 35 | return $guzzleResponse->json();  | 
                                                        
| 36 | 36 | }  | 
                                                        
| 37 | 37 | |
| 38 | - public function postWithJsonBody($endPoint, $body = [])  | 
                                                        |
| 38 | + public function postWithJsonBody ($endPoint, $body = [])  | 
                                                        |
| 39 | 39 |      { | 
                                                        
| 40 | 40 | $this->mockFilter($endPoint);  | 
                                                        
| 41 | 41 | $request = $this->delegated->post($endPoint, ['Content-Type' => 'application/json']);  | 
                                                        
@@ -45,7 +45,7 @@ discard block  | 
                                                    ||
| 45 | 45 | return $guzzleResponse->json();  | 
                                                        
| 46 | 46 | }  | 
                                                        
| 47 | 47 | |
| 48 | - public function get($endPoint, $parameter = [])  | 
                                                        |
| 48 | + public function get ($endPoint, $parameter = [])  | 
                                                        |
| 49 | 49 |      { | 
                                                        
| 50 | 50 | $this->mockFilter($endPoint);  | 
                                                        
| 51 | 51 | $queryString = http_build_query($parameter);  | 
                                                        
@@ -55,12 +55,12 @@ discard block  | 
                                                    ||
| 55 | 55 | return $guzzleResponse->json();  | 
                                                        
| 56 | 56 | }  | 
                                                        
| 57 | 57 | |
| 58 | - public function setDefaultOption($keyOrPath, $value)  | 
                                                        |
| 58 | + public function setDefaultOption ($keyOrPath, $value)  | 
                                                        |
| 59 | 59 |      { | 
                                                        
| 60 | 60 | $this->delegated->setDefaultOption($keyOrPath, $value);  | 
                                                        
| 61 | 61 | }  | 
                                                        
| 62 | 62 | |
| 63 | - private function sendWithCheck(RequestInterface $request)  | 
                                                        |
| 63 | + private function sendWithCheck (RequestInterface $request)  | 
                                                        |
| 64 | 64 |      { | 
                                                        
| 65 | 65 |          try { | 
                                                        
| 66 | 66 | return $request->send();  | 
                                                        
@@ -86,7 +86,7 @@ discard block  | 
                                                    ||
| 86 | 86 | *  | 
                                                        
| 87 | 87 | * @param $endPoint  | 
                                                        
| 88 | 88 | */  | 
                                                        
| 89 | - private function mockFilter($endPoint)  | 
                                                        |
| 89 | + private function mockFilter ($endPoint)  | 
                                                        |
| 90 | 90 |      { | 
                                                        
| 91 | 91 |          if ($this->mockContainer->has($endPoint)) { | 
                                                        
| 92 | 92 | $this->delegated->addSubscriber($this->mockContainer->getMockResponse($endPoint));  | 
                                                        
@@ -10,7 +10,7 @@  | 
                                                    ||
| 10 | 10 | /**  | 
                                                        
| 11 | 11 | * @return ShipmentCollection  | 
                                                        
| 12 | 12 | */  | 
                                                        
| 13 | - public function getResults()  | 
                                                        |
| 13 | + public function getResults ()  | 
                                                        |
| 14 | 14 |      { | 
                                                        
| 15 | 15 | $entities = [];  | 
                                                        
| 16 | 16 |          foreach ($this->attributes->mayHave('results')->asArray() as $attributes) { | 
                                                        
@@ -12,17 +12,17 @@ discard block  | 
                                                    ||
| 12 | 12 | toArray as public __toArray;  | 
                                                        
| 13 | 13 | }  | 
                                                        
| 14 | 14 | |
| 15 | - public function getNext()  | 
                                                        |
| 15 | + public function getNext ()  | 
                                                        |
| 16 | 16 |      { | 
                                                        
| 17 | 17 |          return $this->attributes->mayHave('next')->value(); | 
                                                        
| 18 | 18 | }  | 
                                                        
| 19 | 19 | |
| 20 | - public function getPrevious()  | 
                                                        |
| 20 | + public function getPrevious ()  | 
                                                        |
| 21 | 21 |      { | 
                                                        
| 22 | 22 |          return $this->attributes->mayHave('previous')->value(); | 
                                                        
| 23 | 23 | }  | 
                                                        
| 24 | 24 | |
| 25 | - public function toArray()  | 
                                                        |
| 25 | + public function toArray ()  | 
                                                        |
| 26 | 26 |      { | 
                                                        
| 27 | 27 | $array = $this->__toArray();  | 
                                                        
| 28 | 28 | $array['results'] = $this->getResults()->toArray();  | 
                                                        
@@ -33,5 +33,5 @@ discard block  | 
                                                    ||
| 33 | 33 | /**  | 
                                                        
| 34 | 34 | * @return EntityCollection  | 
                                                        
| 35 | 35 | */  | 
                                                        
| 36 | - abstract public function getResults();  | 
                                                        |
| 36 | + abstract public function getResults ();  | 
                                                        |
| 37 | 37 | }  |