@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $this->part_number = $part->part_number; |
105 | 105 | |
106 | 106 | $default_mask = $this->oMessage->getClient()->getDefaultAttachmentMask(); |
107 | - if($default_mask != null) { |
|
107 | + if ($default_mask != null) { |
|
108 | 108 | $this->mask = $default_mask; |
109 | 109 | } |
110 | 110 | |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | * @throws MethodNotFoundException |
122 | 122 | */ |
123 | 123 | public function __call($method, $arguments) { |
124 | - if(strtolower(substr($method, 0, 3)) === 'get') { |
|
124 | + if (strtolower(substr($method, 0, 3)) === 'get') { |
|
125 | 125 | $name = Str::snake(substr($method, 3)); |
126 | 126 | |
127 | - if(isset($this->attributes[$name])) { |
|
127 | + if (isset($this->attributes[$name])) { |
|
128 | 128 | return $this->attributes[$name]; |
129 | 129 | } |
130 | 130 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * @return mixed|null |
161 | 161 | */ |
162 | 162 | public function __get($name) { |
163 | - if(isset($this->attributes[$name])) { |
|
163 | + if (isset($this->attributes[$name])) { |
|
164 | 164 | return $this->attributes[$name]; |
165 | 165 | } |
166 | 166 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | if (IMAP::ATTACHMENT_TYPE_MESSAGE == $this->part->type) { |
230 | 230 | if ($this->part->ifdescription) { |
231 | 231 | $this->setName($this->part->description); |
232 | - } else { |
|
232 | + }else { |
|
233 | 233 | $this->setName($this->part->subtype); |
234 | 234 | } |
235 | 235 | } |
@@ -255,9 +255,9 @@ discard block |
||
255 | 255 | public function setName($name) { |
256 | 256 | $decoder = $this->config['decoder']['attachment']; |
257 | 257 | if ($name !== null) { |
258 | - if($decoder === 'utf-8' && extension_loaded('imap')) { |
|
258 | + if ($decoder === 'utf-8' && extension_loaded('imap')) { |
|
259 | 259 | $this->name = \imap_utf8($name); |
260 | - }else{ |
|
260 | + }else { |
|
261 | 261 | $this->name = mb_decode_mimeheader($name); |
262 | 262 | } |
263 | 263 | } |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | * |
269 | 269 | * @return string|null |
270 | 270 | */ |
271 | - public function getMimeType(){ |
|
271 | + public function getMimeType() { |
|
272 | 272 | return (new \finfo())->buffer($this->getContent(), FILEINFO_MIME_TYPE); |
273 | 273 | } |
274 | 274 | |
@@ -277,9 +277,9 @@ discard block |
||
277 | 277 | * |
278 | 278 | * @return string|null |
279 | 279 | */ |
280 | - public function getExtension(){ |
|
280 | + public function getExtension() { |
|
281 | 281 | $deprecated_guesser = "\Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser"; |
282 | - if (class_exists($deprecated_guesser) !== false){ |
|
282 | + if (class_exists($deprecated_guesser) !== false) { |
|
283 | 283 | return $deprecated_guesser::getInstance()->guess($this->getMimeType()); |
284 | 284 | } |
285 | 285 | $guesser = "\Symfony\Component\Mime\MimeTypes"; |
@@ -292,14 +292,14 @@ discard block |
||
292 | 292 | * |
293 | 293 | * @return array |
294 | 294 | */ |
295 | - public function getAttributes(){ |
|
295 | + public function getAttributes() { |
|
296 | 296 | return $this->attributes; |
297 | 297 | } |
298 | 298 | |
299 | 299 | /** |
300 | 300 | * @return Message |
301 | 301 | */ |
302 | - public function getMessage(){ |
|
302 | + public function getMessage() { |
|
303 | 303 | return $this->oMessage; |
304 | 304 | } |
305 | 305 | |
@@ -309,8 +309,8 @@ discard block |
||
309 | 309 | * |
310 | 310 | * @return $this |
311 | 311 | */ |
312 | - public function setMask($mask){ |
|
313 | - if(class_exists($mask)){ |
|
312 | + public function setMask($mask) { |
|
313 | + if (class_exists($mask)) { |
|
314 | 314 | $this->mask = $mask; |
315 | 315 | } |
316 | 316 | |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | * |
323 | 323 | * @return string |
324 | 324 | */ |
325 | - public function getMask(){ |
|
325 | + public function getMask() { |
|
326 | 326 | return $this->mask; |
327 | 327 | } |
328 | 328 | |
@@ -333,9 +333,9 @@ discard block |
||
333 | 333 | * @return mixed |
334 | 334 | * @throws MaskNotFoundException |
335 | 335 | */ |
336 | - public function mask($mask = null){ |
|
336 | + public function mask($mask = null) { |
|
337 | 337 | $mask = $mask !== null ? $mask : $this->mask; |
338 | - if(class_exists($mask)){ |
|
338 | + if (class_exists($mask)) { |
|
339 | 339 | return new $mask($this); |
340 | 340 | } |
341 | 341 |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | return null; |
131 | - }elseif (strtolower(substr($method, 0, 3)) === 'set') { |
|
131 | + } elseif (strtolower(substr($method, 0, 3)) === 'set') { |
|
132 | 132 | $name = Str::snake(substr($method, 3)); |
133 | 133 | |
134 | 134 | $this->attributes[$name] = array_pop($arguments); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $this->setName($filename); |
223 | 223 | } elseif (($name = $this->part->name) !== null) { |
224 | 224 | $this->setName($name); |
225 | - }else { |
|
225 | + } else { |
|
226 | 226 | $this->setName("undefined"); |
227 | 227 | } |
228 | 228 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | if ($name !== null) { |
258 | 258 | if($decoder === 'utf-8' && extension_loaded('imap')) { |
259 | 259 | $this->name = \imap_utf8($name); |
260 | - }else{ |
|
260 | + } else{ |
|
261 | 261 | $this->name = mb_decode_mimeheader($name); |
262 | 262 | } |
263 | 263 | } |