@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | abstract class EntityCollection extends \ArrayObject |
6 | 6 | { |
7 | - public function toArray() |
|
7 | + public function toArray () |
|
8 | 8 | { |
9 | 9 | $ret = []; |
10 | 10 | /** @var Entity $entity */ |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @return string |
31 | 31 | */ |
32 | - public function getObjectStatus() |
|
32 | + public function getObjectStatus () |
|
33 | 33 | { |
34 | 34 | return $this->attributes->mayHave('object_status')->asString(); |
35 | 35 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * |
40 | 40 | * @return bool |
41 | 41 | */ |
42 | - public function getWasTest() |
|
42 | + public function getWasTest () |
|
43 | 43 | { |
44 | 44 | return $this->attributes->mayHave('was_test')->asBoolean(); |
45 | 45 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * |
50 | 50 | * @return string |
51 | 51 | */ |
52 | - public function getRate() |
|
52 | + public function getRate () |
|
53 | 53 | { |
54 | 54 | return $this->attributes->mayHave('rate')->asString(); |
55 | 55 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | /** |
58 | 58 | * @return mixed|null |
59 | 59 | */ |
60 | - public function getPickupDate() |
|
60 | + public function getPickupDate () |
|
61 | 61 | { |
62 | 62 | return $this->attributes->mayHave('pickup_date')->value(); |
63 | 63 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @return string |
70 | 70 | */ |
71 | - public function getTrackingNumber() |
|
71 | + public function getTrackingNumber () |
|
72 | 72 | { |
73 | 73 | return $this->attributes->mayHave('tracking_number')->asString(); |
74 | 74 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * |
79 | 79 | * @return TrackingStatus |
80 | 80 | */ |
81 | - public function getTrackingStatus() |
|
81 | + public function getTrackingStatus () |
|
82 | 82 | { |
83 | 83 | return new TrackingStatus($this->attributes->mayHave('tracking_status')->asArray()); |
84 | 84 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | /** |
87 | 87 | * @return TrackingHistory |
88 | 88 | */ |
89 | - public function getTrackingHistory() |
|
89 | + public function getTrackingHistory () |
|
90 | 90 | { |
91 | 91 | $entities = $this->attributes->mayHave('tracking_history') |
92 | 92 | ->asInstanceArray('ShippoClient\\Entity\\TrackingStatus'); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * |
101 | 101 | * @return string |
102 | 102 | */ |
103 | - public function getTrackingUrlProvider() |
|
103 | + public function getTrackingUrlProvider () |
|
104 | 104 | { |
105 | 105 | return $this->attributes->mayHave('tracking_url_provider')->asString(); |
106 | 106 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * |
112 | 112 | * @return string |
113 | 113 | */ |
114 | - public function getLabelUrl() |
|
114 | + public function getLabelUrl () |
|
115 | 115 | { |
116 | 116 | return $this->attributes->mayHave('label_url')->asString(); |
117 | 117 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * |
123 | 123 | * @return string |
124 | 124 | */ |
125 | - public function getCommercialInvoiceUrl() |
|
125 | + public function getCommercialInvoiceUrl () |
|
126 | 126 | { |
127 | 127 | return $this->attributes->mayHave('commercial_invoice_url')->asString(); |
128 | 128 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * |
135 | 135 | * @return array |
136 | 136 | */ |
137 | - public function getMessages() |
|
137 | + public function getMessages () |
|
138 | 138 | { |
139 | 139 | return $this->attributes->mayHave('messages')->asArray(); |
140 | 140 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | /** |
143 | 143 | * @return mixed|null |
144 | 144 | */ |
145 | - public function getOrder() |
|
145 | + public function getOrder () |
|
146 | 146 | { |
147 | 147 | return $this->attributes->mayHave('order')->value(); |
148 | 148 | } |
@@ -150,12 +150,12 @@ discard block |
||
150 | 150 | /** |
151 | 151 | * @return string |
152 | 152 | */ |
153 | - public function getMetadata() |
|
153 | + public function getMetadata () |
|
154 | 154 | { |
155 | 155 | return $this->attributes->mayHave('metadata')->asString(); |
156 | 156 | } |
157 | 157 | |
158 | - public function toArray() |
|
158 | + public function toArray () |
|
159 | 159 | { |
160 | 160 | $array = $this->__toArray(); |
161 | 161 | $array['tracking_status'] = $this->getTrackingStatus()->toArray(); |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use ShippoClient\Entity\Parcel; |
6 | 6 | use ShippoClient\Entity\ParcelCollection; |
7 | -use TurmericSpice\Container; |
|
8 | 7 | |
9 | 8 | class ParcelList extends ListResponse |
10 | 9 | { |
@@ -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 | } |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use ShippoClient\Entity\Parcel; |
6 | 6 | use ShippoClient\Entity\ParcelCollection; |
7 | -use TurmericSpice\Container; |
|
8 | 7 | |
9 | 8 | class ParcelList extends ListResponse |
10 | 9 | { |
@@ -62,6 +62,9 @@ |
||
62 | 62 | return (bool)$is_residential; |
63 | 63 | } |
64 | 64 | |
65 | + /** |
|
66 | + * @param string $propertyName |
|
67 | + */ |
|
65 | 68 | private function mayHaveAsAsciiString($propertyName, callable $validate = null) |
66 | 69 | { |
67 | 70 | return $this->transliterateToAscii( |
@@ -17,42 +17,42 @@ discard block |
||
17 | 17 | mayHaveAsArray as public getMessages; |
18 | 18 | } |
19 | 19 | |
20 | - public function getName() |
|
20 | + public function getName () |
|
21 | 21 | { |
22 | 22 | return $this->mayHaveAsAsciiString('name'); |
23 | 23 | } |
24 | 24 | |
25 | - public function getCompany() |
|
25 | + public function getCompany () |
|
26 | 26 | { |
27 | 27 | return $this->mayHaveAsAsciiString('company'); |
28 | 28 | } |
29 | 29 | |
30 | - public function getStreet1() |
|
30 | + public function getStreet1 () |
|
31 | 31 | { |
32 | 32 | return $this->mayHaveAsAsciiString('street1'); |
33 | 33 | } |
34 | 34 | |
35 | - public function getStreet2() |
|
35 | + public function getStreet2 () |
|
36 | 36 | { |
37 | 37 | return $this->mayHaveAsAsciiString('street2'); |
38 | 38 | } |
39 | 39 | |
40 | - public function getStreetNo() |
|
40 | + public function getStreetNo () |
|
41 | 41 | { |
42 | 42 | return $this->mayHaveAsAsciiString('street_no'); |
43 | 43 | } |
44 | 44 | |
45 | - public function getCity() |
|
45 | + public function getCity () |
|
46 | 46 | { |
47 | 47 | return $this->mayHaveAsAsciiString('city'); |
48 | 48 | } |
49 | 49 | |
50 | - public function getState() |
|
50 | + public function getState () |
|
51 | 51 | { |
52 | 52 | return $this->mayHaveAsAsciiString('state'); |
53 | 53 | } |
54 | 54 | |
55 | - public function getIsResidential() |
|
55 | + public function getIsResidential () |
|
56 | 56 | { |
57 | 57 | $is_residential = $this->attributes->mayHave('is_residential')->value(); |
58 | 58 | if ($is_residential === null) { |
@@ -62,21 +62,21 @@ discard block |
||
62 | 62 | return (bool)$is_residential; |
63 | 63 | } |
64 | 64 | |
65 | - private function mayHaveAsAsciiString($propertyName, callable $validate = null) |
|
65 | + private function mayHaveAsAsciiString ($propertyName, callable $validate = null) |
|
66 | 66 | { |
67 | 67 | return $this->transliterateToAscii( |
68 | 68 | $this->attributes->mayHave($propertyName)->asString($validate) |
69 | 69 | ); |
70 | 70 | } |
71 | 71 | |
72 | - private function mustHaveAsAsciiString($propertyName, callable $validate = null) |
|
72 | + private function mustHaveAsAsciiString ($propertyName, callable $validate = null) |
|
73 | 73 | { |
74 | 74 | return $this->transliterateToAscii( |
75 | 75 | $this->attributes->mustHave($propertyName)->asString($validate) |
76 | 76 | ); |
77 | 77 | } |
78 | 78 | |
79 | - private function transliterateToAscii($str) |
|
79 | + private function transliterateToAscii ($str) |
|
80 | 80 | { |
81 | 81 | $ret = ''; |
82 | 82 | foreach (preg_split('//u', $str) as $ch) { |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use ShippoClient\Entity\Parcel; |
6 | 6 | use ShippoClient\Entity\ParcelCollection; |
7 | -use TurmericSpice\Container; |
|
8 | 7 | |
9 | 8 | class ParcelList extends ListResponse |
10 | 9 | { |
@@ -10,7 +10,7 @@ |
||
10 | 10 | /** |
11 | 11 | * @return RefundCollection |
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) { |
@@ -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 @@ |
||
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 @@ |
||
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 @@ |
||
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 | } |