@@ -159,10 +159,10 @@ discard block |
||
159 | 159 | * |
160 | 160 | * @throws InvalidMessageDateException |
161 | 161 | */ |
162 | - protected function parse(){ |
|
162 | + protected function parse() { |
|
163 | 163 | if ($this->header === null) { |
164 | 164 | $body = $this->findHeaders(); |
165 | - }else{ |
|
165 | + }else { |
|
166 | 166 | $body = $this->raw; |
167 | 167 | } |
168 | 168 | |
@@ -175,18 +175,18 @@ discard block |
||
175 | 175 | $this->name = $this->header->get("name"); |
176 | 176 | $this->filename = $this->header->get("filename"); |
177 | 177 | |
178 | - if(!empty($this->header->get("id"))) { |
|
178 | + if (!empty($this->header->get("id"))) { |
|
179 | 179 | $this->id = $this->header->get("id"); |
180 | - } else if(!empty($this->header->get("x-attachment-id"))){ |
|
180 | + }else if (!empty($this->header->get("x-attachment-id"))) { |
|
181 | 181 | $this->id = $this->header->get("x-attachment-id"); |
182 | - } else if(!empty($this->header->get("content-id"))){ |
|
182 | + }else if (!empty($this->header->get("content-id"))) { |
|
183 | 183 | $this->id = strtr($this->header->get("content-id"), [ |
184 | 184 | '<' => '', |
185 | 185 | '>' => '' |
186 | 186 | ]); |
187 | 187 | } |
188 | 188 | |
189 | - if(!empty($this->header->get("content-type"))){ |
|
189 | + if (!empty($this->header->get("content-type"))) { |
|
190 | 190 | $rawContentType = $this->header->get("content-type"); |
191 | 191 | $contentTypeArray = explode(';', $rawContentType); |
192 | 192 | $this->content_type = trim($contentTypeArray[0]); |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | * @return string |
204 | 204 | * @throws InvalidMessageDateException |
205 | 205 | */ |
206 | - private function findHeaders(){ |
|
206 | + private function findHeaders() { |
|
207 | 207 | $body = $this->raw; |
208 | 208 | while (($pos = strpos($body, "\r\n")) > 0) { |
209 | 209 | $body = substr($body, $pos + 2); |
@@ -219,9 +219,9 @@ discard block |
||
219 | 219 | /** |
220 | 220 | * Try to parse the subtype if any is present |
221 | 221 | */ |
222 | - private function parseSubtype(){ |
|
222 | + private function parseSubtype() { |
|
223 | 223 | $content_type = $this->header->get("content-type"); |
224 | - if (($pos = strpos($content_type, "/")) !== false){ |
|
224 | + if (($pos = strpos($content_type, "/")) !== false) { |
|
225 | 225 | $this->subtype = substr($content_type, $pos + 1); |
226 | 226 | } |
227 | 227 | } |
@@ -229,9 +229,9 @@ discard block |
||
229 | 229 | /** |
230 | 230 | * Try to parse the disposition if any is present |
231 | 231 | */ |
232 | - private function parseDisposition(){ |
|
232 | + private function parseDisposition() { |
|
233 | 233 | $content_disposition = $this->header->get("content-disposition"); |
234 | - if($content_disposition !== null) { |
|
234 | + if ($content_disposition !== null) { |
|
235 | 235 | $this->ifdisposition = true; |
236 | 236 | $this->disposition = (is_array($content_disposition)) ? implode(' ', $content_disposition) : $content_disposition; |
237 | 237 | } |
@@ -240,9 +240,9 @@ discard block |
||
240 | 240 | /** |
241 | 241 | * Try to parse the description if any is present |
242 | 242 | */ |
243 | - private function parseDescription(){ |
|
243 | + private function parseDescription() { |
|
244 | 244 | $content_description = $this->header->get("content-description"); |
245 | - if($content_description !== null) { |
|
245 | + if ($content_description !== null) { |
|
246 | 246 | $this->ifdescription = true; |
247 | 247 | $this->description = $content_description; |
248 | 248 | } |
@@ -251,9 +251,9 @@ discard block |
||
251 | 251 | /** |
252 | 252 | * Try to parse the encoding if any is present |
253 | 253 | */ |
254 | - private function parseEncoding(){ |
|
254 | + private function parseEncoding() { |
|
255 | 255 | $encoding = $this->header->get("content-transfer-encoding"); |
256 | - if($encoding !== null) { |
|
256 | + if ($encoding !== null) { |
|
257 | 257 | switch (strtolower($encoding)) { |
258 | 258 | case "quoted-printable": |
259 | 259 | $this->encoding = IMAP::MESSAGE_ENC_QUOTED_PRINTABLE; |