@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace Fazland\SkebbyRestClient\Exception; |
4 | 4 | |
@@ -21,15 +21,15 @@ discard block |
||
21 | 21 | |
22 | 22 | public function __toString() |
23 | 23 | { |
24 | - return '[' . get_class($this) . '] ' . $this->message . "\n" . |
|
25 | - 'Response: ' . "\n" . |
|
24 | + return '['.get_class($this).'] '.$this->message."\n". |
|
25 | + 'Response: '."\n". |
|
26 | 26 | $this->response |
27 | 27 | ; |
28 | 28 | } |
29 | 29 | |
30 | 30 | private function decodeXmlError(\LibXMLError $error, $xml) |
31 | 31 | { |
32 | - $return = $xml[$error->line - 1] . "\n"; |
|
32 | + $return = $xml[$error->line - 1]."\n"; |
|
33 | 33 | |
34 | 34 | switch ($error->level) { |
35 | 35 | case LIBXML_ERR_WARNING: |
@@ -45,14 +45,14 @@ discard block |
||
45 | 45 | break; |
46 | 46 | } |
47 | 47 | |
48 | - $return .= trim($error->message) . |
|
49 | - "\n Line: $error->line" . |
|
48 | + $return .= trim($error->message). |
|
49 | + "\n Line: $error->line". |
|
50 | 50 | "\n Column: $error->column"; |
51 | 51 | |
52 | 52 | if ($error->file) { |
53 | 53 | $return .= "\n File: $error->file"; |
54 | 54 | } |
55 | 55 | |
56 | - return $return . "\n\n"; |
|
56 | + return $return."\n\n"; |
|
57 | 57 | } |
58 | 58 | } |
@@ -60,22 +60,22 @@ |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | foreach (SendMethods::all() as $method) { |
63 | - if (! isset($doc->$method)) { |
|
63 | + if (!isset($doc->$method)) { |
|
64 | 64 | continue; |
65 | 65 | } |
66 | 66 | |
67 | 67 | $element = $doc->$method; |
68 | 68 | |
69 | - if (! isset($element->status)) { |
|
69 | + if (!isset($element->status)) { |
|
70 | 70 | throw new UnknownErrorResponseException('Missing response status value from Skebby', $rawResponse); |
71 | 71 | } |
72 | 72 | |
73 | - $this->status = (string)$element->status; |
|
74 | - $this->messageId = isset($element->id) ? (string)$element->id : null; |
|
73 | + $this->status = (string) $element->status; |
|
74 | + $this->messageId = isset($element->id) ? (string) $element->id : null; |
|
75 | 75 | |
76 | - if (! $this->isSuccessful()) { |
|
77 | - $this->code = isset($element->code) ? (string)$element->code : null; |
|
78 | - $this->errorMessage = isset($element->message) ? (string)$element->message : 'Unknown error'; |
|
76 | + if (!$this->isSuccessful()) { |
|
77 | + $this->code = isset($element->code) ? (string) $element->code : null; |
|
78 | + $this->errorMessage = isset($element->message) ? (string) $element->message : 'Unknown error'; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | return; |