@@ -7,7 +7,7 @@ |
||
7 | 7 | /** |
8 | 8 | * @param TrackingStatus[] $entities |
9 | 9 | */ |
10 | - public function __construct(array $entities) |
|
10 | + public function __construct (array $entities) |
|
11 | 11 | { |
12 | 12 | parent::__construct($entities); |
13 | 13 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | mayHaveAsArray as public getMessages; |
25 | 25 | } |
26 | 26 | |
27 | - public function getIsResidential() |
|
27 | + public function getIsResidential () |
|
28 | 28 | { |
29 | 29 | $is_residential = $this->attributes->mayHave('is_residential')->value(); |
30 | 30 | if ($is_residential === null) { |
@@ -7,7 +7,7 @@ |
||
7 | 7 | /** |
8 | 8 | * @param Address[] $entities |
9 | 9 | */ |
10 | - public function __construct(array $entities) |
|
10 | + public function __construct (array $entities) |
|
11 | 11 | { |
12 | 12 | parent::__construct($entities); |
13 | 13 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | |
8 | 8 | class CreateObjectByNested extends CreateObject |
9 | 9 | { |
10 | - public function getAddressFrom() |
|
10 | + public function getAddressFrom () |
|
11 | 11 | { |
12 | 12 | $addressFrom = $this->attributes->mustHave('address_from')->asArray(); |
13 | 13 | $addressFromObj = new AddressCreate($addressFrom); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | return $addressFromObj->toArray(); |
16 | 16 | } |
17 | 17 | |
18 | - public function getAddressTo() |
|
18 | + public function getAddressTo () |
|
19 | 19 | { |
20 | 20 | $addressTo = $this->attributes->mustHave('address_to')->asArray(); |
21 | 21 | $addressToObj = new AddressCreate($addressTo); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | return $addressToObj->toArray(); |
24 | 24 | } |
25 | 25 | |
26 | - public function getParcel() |
|
26 | + public function getParcel () |
|
27 | 27 | { |
28 | 28 | $parcel = $this->attributes->mustHave('parcel')->asArray(); |
29 | 29 | $parcelObj = new ParcelCreate($parcel); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * |
18 | 18 | * @return \DateTime |
19 | 19 | */ |
20 | - public function getObjectCreated() |
|
20 | + public function getObjectCreated () |
|
21 | 21 | { |
22 | 22 | return $this->attributes->mayHave('object_created')->asInstanceOf('\\DateTime'); |
23 | 23 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @return \DateTime |
29 | 29 | */ |
30 | - public function getObjectUpdated() |
|
30 | + public function getObjectUpdated () |
|
31 | 31 | { |
32 | 32 | return $this->attributes->mayHave('object_updated')->asInstanceOf('\\DateTime'); |
33 | 33 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | * |
38 | 38 | * @return string |
39 | 39 | */ |
40 | - public function getObjectId() |
|
40 | + public function getObjectId () |
|
41 | 41 | { |
42 | 42 | return $this->attributes->mayHave('object_id')->asString(); |
43 | 43 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * |
56 | 56 | * @return string |
57 | 57 | */ |
58 | - public function getStatus() |
|
58 | + public function getStatus () |
|
59 | 59 | { |
60 | 60 | return $this->attributes->mayHave('status')->asString(); |
61 | 61 | } |
@@ -63,13 +63,13 @@ discard block |
||
63 | 63 | /** |
64 | 64 | * @return Location |
65 | 65 | */ |
66 | - public function getLocation() |
|
66 | + public function getLocation () |
|
67 | 67 | { |
68 | 68 | $attributes = $this->attributes->mayHave('location')->asArray(); |
69 | 69 | return new Location($attributes); |
70 | 70 | } |
71 | 71 | |
72 | - public function toArray() |
|
72 | + public function toArray () |
|
73 | 73 | { |
74 | 74 | return [ |
75 | 75 | 'object_created' => $this->getObjectCreated(), |
@@ -21,52 +21,52 @@ discard block |
||
21 | 21 | */ |
22 | 22 | private static $instance = null; |
23 | 23 | |
24 | - private function __construct(Request $request) |
|
24 | + private function __construct (Request $request) |
|
25 | 25 | { |
26 | 26 | $this->request = $request; |
27 | 27 | } |
28 | 28 | |
29 | - public function addresses() |
|
29 | + public function addresses () |
|
30 | 30 | { |
31 | 31 | return new Addresses($this->request); |
32 | 32 | } |
33 | 33 | |
34 | - public function parcels() |
|
34 | + public function parcels () |
|
35 | 35 | { |
36 | 36 | return new Parcels($this->request); |
37 | 37 | } |
38 | 38 | |
39 | - public function shipments() |
|
39 | + public function shipments () |
|
40 | 40 | { |
41 | 41 | return new Shipments($this->request); |
42 | 42 | } |
43 | 43 | |
44 | - public function rates() |
|
44 | + public function rates () |
|
45 | 45 | { |
46 | 46 | return new Rates($this->request); |
47 | 47 | } |
48 | 48 | |
49 | - public function transactions() |
|
49 | + public function transactions () |
|
50 | 50 | { |
51 | 51 | return new Transactions($this->request); |
52 | 52 | } |
53 | 53 | |
54 | - public function refunds() |
|
54 | + public function refunds () |
|
55 | 55 | { |
56 | 56 | return new Refunds($this->request); |
57 | 57 | } |
58 | 58 | |
59 | - public function tracks() |
|
59 | + public function tracks () |
|
60 | 60 | { |
61 | 61 | return new Tracks($this->request); |
62 | 62 | } |
63 | 63 | |
64 | - public function getAccessToken() |
|
64 | + public function getAccessToken () |
|
65 | 65 | { |
66 | 66 | return $this->accessToken; |
67 | 67 | } |
68 | 68 | |
69 | - public function setRequestOption($keyOrPath, $value) |
|
69 | + public function setRequestOption ($keyOrPath, $value) |
|
70 | 70 | { |
71 | 71 | $this->request->setDefaultOption($keyOrPath, $value); |
72 | 72 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @param string $accessToken |
78 | 78 | * @return static |
79 | 79 | */ |
80 | - public static function provider($accessToken) |
|
80 | + public static function provider ($accessToken) |
|
81 | 81 | { |
82 | 82 | if (static::$instance !== null && static::$instance->getAccessToken() === $accessToken) { |
83 | 83 | return static::$instance; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | return static::$instance; |
89 | 89 | } |
90 | 90 | |
91 | - public static function mock() |
|
91 | + public static function mock () |
|
92 | 92 | { |
93 | 93 | return MockCollection::getInstance(); |
94 | 94 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @return string |
34 | 34 | */ |
35 | - public function getObjectStatus() |
|
35 | + public function getObjectStatus () |
|
36 | 36 | { |
37 | 37 | return $this->attributes->mayHave('object_status')->asString(); |
38 | 38 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * |
43 | 43 | * @return bool |
44 | 44 | */ |
45 | - public function getWasTest() |
|
45 | + public function getWasTest () |
|
46 | 46 | { |
47 | 47 | return $this->attributes->mayHave('was_test')->asBoolean(); |
48 | 48 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @return string |
54 | 54 | */ |
55 | - public function getRate() |
|
55 | + public function getRate () |
|
56 | 56 | { |
57 | 57 | return $this->attributes->mayHave('rate')->asString(); |
58 | 58 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * |
64 | 64 | * @return string |
65 | 65 | */ |
66 | - public function getTrackingNumber() |
|
66 | + public function getTrackingNumber () |
|
67 | 67 | { |
68 | 68 | return $this->attributes->mayHave('tracking_number')->asString(); |
69 | 69 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * |
74 | 74 | * @return TrackingStatus |
75 | 75 | */ |
76 | - public function getTrackingStatus() |
|
76 | + public function getTrackingStatus () |
|
77 | 77 | { |
78 | 78 | return new TrackingStatus($this->attributes->mayHave('tracking_status')->asArray()); |
79 | 79 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | /** |
82 | 82 | * @return TrackingHistory |
83 | 83 | */ |
84 | - public function getTrackingHistory() |
|
84 | + public function getTrackingHistory () |
|
85 | 85 | { |
86 | 86 | $entities = $this->attributes->mayHave('tracking_history') |
87 | 87 | ->asInstanceArray('ShippoClient\\Entity\\TrackingStatus'); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * |
96 | 96 | * @return string |
97 | 97 | */ |
98 | - public function getTrackingUrlProvider() |
|
98 | + public function getTrackingUrlProvider () |
|
99 | 99 | { |
100 | 100 | return $this->attributes->mayHave('tracking_url_provider')->asString(); |
101 | 101 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | * |
107 | 107 | * @return string |
108 | 108 | */ |
109 | - public function getLabelUrl() |
|
109 | + public function getLabelUrl () |
|
110 | 110 | { |
111 | 111 | return $this->attributes->mayHave('label_url')->asString(); |
112 | 112 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * |
118 | 118 | * @return string |
119 | 119 | */ |
120 | - public function getCommercialInvoiceUrl() |
|
120 | + public function getCommercialInvoiceUrl () |
|
121 | 121 | { |
122 | 122 | return $this->attributes->mayHave('commercial_invoice_url')->asString(); |
123 | 123 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | * |
130 | 130 | * @return array |
131 | 131 | */ |
132 | - public function getMessages() |
|
132 | + public function getMessages () |
|
133 | 133 | { |
134 | 134 | return $this->attributes->mayHave('messages')->asArray(); |
135 | 135 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | /** |
138 | 138 | * @return mixed|null |
139 | 139 | */ |
140 | - public function getOrder() |
|
140 | + public function getOrder () |
|
141 | 141 | { |
142 | 142 | return $this->attributes->mayHave('order')->value(); |
143 | 143 | } |
@@ -145,12 +145,12 @@ discard block |
||
145 | 145 | /** |
146 | 146 | * @return string |
147 | 147 | */ |
148 | - public function getMetadata() |
|
148 | + public function getMetadata () |
|
149 | 149 | { |
150 | 150 | return $this->attributes->mayHave('metadata')->asString(); |
151 | 151 | } |
152 | 152 | |
153 | - public function toArray() |
|
153 | + public function toArray () |
|
154 | 154 | { |
155 | 155 | $array = $this->__toArray(); |
156 | 156 | $array['tracking_status'] = $this->getTrackingStatus()->toArray(); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * |
39 | 39 | * @return \DateTime |
40 | 40 | */ |
41 | - public function getObjectCreated() |
|
41 | + public function getObjectCreated () |
|
42 | 42 | { |
43 | 43 | return $this->attributes->mayHave('object_created')->asInstanceOf('\\DateTime'); |
44 | 44 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * |
49 | 49 | * @return \DateTime |
50 | 50 | */ |
51 | - public function getObjectUpdated() |
|
51 | + public function getObjectUpdated () |
|
52 | 52 | { |
53 | 53 | return $this->attributes->mayHave('object_updated')->asInstanceOf('\\DateTime'); |
54 | 54 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * |
59 | 59 | * @return \ShippoClient\Entity\Location |
60 | 60 | */ |
61 | - public function getAddressFrom() |
|
61 | + public function getAddressFrom () |
|
62 | 62 | { |
63 | 63 | $addressFrom = $this->attributes->mayHave('address_from')->asArray(); |
64 | 64 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * |
71 | 71 | * @return \ShippoClient\Entity\Location |
72 | 72 | */ |
73 | - public function getAddressTo() |
|
73 | + public function getAddressTo () |
|
74 | 74 | { |
75 | 75 | $addressTo = $this->attributes->mayHave('address_to')->asArray(); |
76 | 76 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * |
83 | 83 | * @return \ShippoClient\Entity\ServiceLevel |
84 | 84 | */ |
85 | - public function getServiceLevel() |
|
85 | + public function getServiceLevel () |
|
86 | 86 | { |
87 | 87 | $serviceLevel = $this->attributes->mayHave('servicelevel')->asArray(); |
88 | 88 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * |
95 | 95 | * @return \ShippoClient\Entity\TrackingStatus |
96 | 96 | */ |
97 | - public function getTrackingStatus() |
|
97 | + public function getTrackingStatus () |
|
98 | 98 | { |
99 | 99 | return new TrackingStatus($this->attributes->mayHave('tracking_status')->asArray()); |
100 | 100 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * |
105 | 105 | * @return \ShippoClient\Entity\TrackingHistory |
106 | 106 | */ |
107 | - public function getTrackingHistory() |
|
107 | + public function getTrackingHistory () |
|
108 | 108 | { |
109 | 109 | $entities = $this->attributes->mayHave('tracking_history') |
110 | 110 | ->asInstanceArray('ShippoClient\\Entity\\TrackingStatus'); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | return new TrackingHistory($entities); |
113 | 113 | } |
114 | 114 | |
115 | - public function toArray() |
|
115 | + public function toArray () |
|
116 | 116 | { |
117 | 117 | return [ |
118 | 118 | // tracks |
@@ -9,19 +9,19 @@ |
||
9 | 9 | { |
10 | 10 | private $request; |
11 | 11 | |
12 | - public function __construct(Request $request) |
|
12 | + public function __construct (Request $request) |
|
13 | 13 | { |
14 | 14 | $this->request = $request; |
15 | 15 | } |
16 | 16 | |
17 | - public function getStandaloneTrack($carrier, $trackingNumber) |
|
17 | + public function getStandaloneTrack ($carrier, $trackingNumber) |
|
18 | 18 | { |
19 | 19 | $responseArray = $this->request->get("tracks/$carrier/$trackingNumber"); |
20 | 20 | |
21 | 21 | return new TracksResponse($responseArray); |
22 | 22 | } |
23 | 23 | |
24 | - public function create($carrier, $trackingNumber, $metadata = null) |
|
24 | + public function create ($carrier, $trackingNumber, $metadata = null) |
|
25 | 25 | { |
26 | 26 | $responseArray = $this->request->post('tracks/', [ |
27 | 27 | 'carrier' => $carrier, |