@@ -41,30 +41,30 @@ discard block |
||
| 41 | 41 | $this->getTrackingInformation(); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - private function fetchTranslations(){ |
|
| 44 | + private function fetchTranslations() { |
|
| 45 | 45 | $curl = new Curl(); |
| 46 | 46 | $curl->get(self::BPOST_API_ENDPOINT . 'translations?lang=' . self::LANGUAGE); |
| 47 | 47 | |
| 48 | - if($curl->error){ |
|
| 48 | + if ($curl->error) { |
|
| 49 | 49 | throw new Exception('CURL error while fetching translations: ' . $curl->errorCode . ': ' . $curl->errorMessage); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | $this->translationsCache = $curl->response; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - private function translateKey($key){ |
|
| 56 | - if($this->translationsCache == null){ |
|
| 55 | + private function translateKey($key) { |
|
| 56 | + if ($this->translationsCache == null) { |
|
| 57 | 57 | $this->fetchTranslations(); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | return $this->translationsCache->event->$key->description; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - private function getTrackingInformation(){ |
|
| 63 | + private function getTrackingInformation() { |
|
| 64 | 64 | $curl = new Curl(); |
| 65 | 65 | $curl->get(self::BPOST_API_ENDPOINT . 'items?itemIdentifier=' . $this->getItemNumber()); |
| 66 | 66 | |
| 67 | - if($curl->error){ |
|
| 67 | + if ($curl->error) { |
|
| 68 | 68 | throw new Exception('CURL error while fetching tracking information: ' . $curl->errorCode . ': ' . $curl->errorMessage); |
| 69 | 69 | } |
| 70 | 70 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | // Decode events |
| 89 | 89 | $rawEvents = $response->events; |
| 90 | 90 | |
| 91 | - foreach($rawEvents as $rawEvent){ |
|
| 91 | + foreach ($rawEvents as $rawEvent) { |
|
| 92 | 92 | $lang = self::LANGUAGE; |
| 93 | 93 | $eventDescription = $this->translateKey($rawEvent->key); |
| 94 | 94 | |