1 | <?php |
||
54 | class Pakkelabels |
||
55 | { |
||
56 | |||
57 | /** |
||
58 | * API Endpoint URL |
||
59 | * |
||
60 | * @var string |
||
61 | */ |
||
62 | const API_ENDPOINT = 'https://app.pakkelabels.dk/api/public/v2'; |
||
63 | |||
64 | /** |
||
65 | * API Endpoint URL |
||
66 | * |
||
67 | * @var string |
||
68 | */ |
||
69 | const VERSION = '1.1'; |
||
70 | |||
71 | /** |
||
72 | * API user |
||
73 | * |
||
74 | * @var string |
||
75 | */ |
||
76 | protected $api_user; |
||
77 | |||
78 | /** |
||
79 | * API key |
||
80 | * |
||
81 | * @var string |
||
82 | */ |
||
83 | protected $api_key; |
||
84 | |||
85 | /** |
||
86 | * Token |
||
87 | * |
||
88 | * @var string |
||
89 | */ |
||
90 | protected $token; |
||
91 | |||
92 | /** |
||
93 | * Constructor |
||
94 | * |
||
95 | * @param string $api_user |
||
96 | * @param string $api_key |
||
97 | * |
||
98 | * @throws \PakkelabelsException |
||
99 | */ |
||
100 | 1 | public function __construct($api_user, $api_key) |
|
106 | |||
107 | /** |
||
108 | * Login |
||
109 | * |
||
110 | * @return void |
||
111 | * @throws \PakkelabelsException |
||
112 | */ |
||
113 | 1 | protected function login() |
|
122 | |||
123 | /** |
||
124 | * Get balance |
||
125 | * |
||
126 | * @return void |
||
127 | * @throws \PakkelabelsException |
||
128 | */ |
||
129 | public function balance() |
||
134 | |||
135 | /** |
||
136 | * Get PDF |
||
137 | * |
||
138 | * @return base64 encoded string |
||
139 | * @throws \PakkelabelsException |
||
140 | */ |
||
141 | public function pdf($id) |
||
146 | |||
147 | /** |
||
148 | * Get pickup points. |
||
149 | * |
||
150 | * @param array $params |
||
151 | * |
||
152 | * @return mixed |
||
153 | * @throws \PakkelabelsException |
||
154 | */ |
||
155 | public function getPickupPoints($params = array()) |
||
159 | |||
160 | /** |
||
161 | * Search shipments |
||
162 | * |
||
163 | * @param array $params |
||
164 | * |
||
165 | * @return mixed |
||
166 | * @throws \PakkelabelsException |
||
167 | */ |
||
168 | public function shipments($params = array()) |
||
173 | |||
174 | /** |
||
175 | * Get imported shipments |
||
176 | * |
||
177 | * @param array $params |
||
178 | * |
||
179 | * @return mixed |
||
180 | * @throws \PakkelabelsException |
||
181 | */ |
||
182 | public function importedShipments($params = array()) |
||
187 | |||
188 | /** |
||
189 | * Create imported shipment |
||
190 | * |
||
191 | * @param array $params |
||
192 | * |
||
193 | * @return mixed |
||
194 | * @throws \PakkelabelsException |
||
195 | */ |
||
196 | public function createImportedShipment($params) |
||
201 | |||
202 | /** |
||
203 | * Create shipment |
||
204 | * |
||
205 | * @param array $param |
||
|
|||
206 | * |
||
207 | * @return mixed |
||
208 | * @throws \PakkelabelsException |
||
209 | */ |
||
210 | public function createShipment($params) |
||
215 | |||
216 | /** |
||
217 | * Get freight rates |
||
218 | * |
||
219 | * @param array $params |
||
220 | * |
||
221 | * @return mixed |
||
222 | * @throws \PakkelabelsException |
||
223 | */ |
||
224 | public function freightRates($params = array()) |
||
229 | |||
230 | /** |
||
231 | * Get payment requests |
||
232 | * |
||
233 | * @return mixed |
||
234 | * @throws \PakkelabelsException |
||
235 | */ |
||
236 | public function paymentRequests() |
||
241 | |||
242 | /** |
||
243 | * Get GLS Droppoints |
||
244 | * |
||
245 | * @param array $params |
||
246 | * |
||
247 | * @return mixed |
||
248 | * @throws \PakkelabelsException |
||
249 | */ |
||
250 | public function glsDroppoints($params) |
||
255 | |||
256 | /** |
||
257 | * Get PostDK Droppoints |
||
258 | * |
||
259 | * @param array $params |
||
260 | * |
||
261 | * @return mixed |
||
262 | * @throws \PakkelabelsException |
||
263 | */ |
||
264 | public function pdkDroppoints($params) |
||
268 | |||
269 | /** |
||
270 | * Get token |
||
271 | * |
||
272 | * @return string |
||
273 | */ |
||
274 | public function getToken() |
||
278 | |||
279 | /** |
||
280 | * Make API Call |
||
281 | * |
||
282 | * @param string $method |
||
283 | * @param boolean $doPost |
||
284 | * @param array $params |
||
285 | * |
||
286 | * @return mixed |
||
287 | * @throws \PakkelabelsException |
||
288 | */ |
||
289 | 1 | protected function makeApiCall($method, $doPost = false, $params = array()) |
|
315 | } |
||
316 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.