@@ -50,7 +50,9 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function __get(string $key) |
| 52 | 52 | { |
| 53 | - if (is_object($this->payload)) return $this->payload->$key; |
|
| 53 | + if (is_object($this->payload)) { |
|
| 54 | + return $this->payload->$key; |
|
| 55 | + } |
|
| 54 | 56 | return $this->payload[$key]; |
| 55 | 57 | } |
| 56 | 58 | /** |
@@ -61,7 +63,9 @@ discard block |
||
| 61 | 63 | public function __toString():string |
| 62 | 64 | { |
| 63 | 65 | $buff = $refactor->toArray(); |
| 64 | - if ($buff != null) return json_encode($buff); |
|
| 66 | + if ($buff != null) { |
|
| 67 | + return json_encode($buff); |
|
| 68 | + } |
|
| 65 | 69 | |
| 66 | 70 | return json_encode($this->payload); |
| 67 | 71 | } |
@@ -101,7 +105,9 @@ discard block |
||
| 101 | 105 | */ |
| 102 | 106 | public function toArray():array |
| 103 | 107 | { |
| 104 | - if (is_array($this->payload)) return $this->payload; |
|
| 108 | + if (is_array($this->payload)) { |
|
| 109 | + return $this->payload; |
|
| 110 | + } |
|
| 105 | 111 | return json_decode(json_encode($this->payload), true); |
| 106 | 112 | } |
| 107 | 113 | } |