@@ -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 | |
@@ -223,14 +223,14 @@ discard block |
||
| 223 | 223 | $this->setName($name); |
| 224 | 224 | }elseif (($filename = $this->part->filename) !== null) { |
| 225 | 225 | $this->setName($filename); |
| 226 | - } else { |
|
| 226 | + }else { |
|
| 227 | 227 | $this->setName("undefined"); |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | if (IMAP::ATTACHMENT_TYPE_MESSAGE == $this->part->type) { |
| 231 | 231 | if ($this->part->ifdescription) { |
| 232 | 232 | $this->setName($this->part->description); |
| 233 | - } else { |
|
| 233 | + }else { |
|
| 234 | 234 | $this->setName($this->part->subtype); |
| 235 | 235 | } |
| 236 | 236 | } |
@@ -256,9 +256,9 @@ discard block |
||
| 256 | 256 | public function setName($name) { |
| 257 | 257 | $decoder = $this->config['decoder']['attachment']; |
| 258 | 258 | if ($name !== null) { |
| 259 | - if($decoder === 'utf-8' && extension_loaded('imap')) { |
|
| 259 | + if ($decoder === 'utf-8' && extension_loaded('imap')) { |
|
| 260 | 260 | $this->name = \imap_utf8($name); |
| 261 | - }else{ |
|
| 261 | + }else { |
|
| 262 | 262 | $this->name = mb_decode_mimeheader($name); |
| 263 | 263 | } |
| 264 | 264 | } |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | * |
| 270 | 270 | * @return string|null |
| 271 | 271 | */ |
| 272 | - public function getMimeType(){ |
|
| 272 | + public function getMimeType() { |
|
| 273 | 273 | return (new \finfo())->buffer($this->getContent(), FILEINFO_MIME_TYPE); |
| 274 | 274 | } |
| 275 | 275 | |
@@ -278,9 +278,9 @@ discard block |
||
| 278 | 278 | * |
| 279 | 279 | * @return string|null |
| 280 | 280 | */ |
| 281 | - public function getExtension(){ |
|
| 281 | + public function getExtension() { |
|
| 282 | 282 | $deprecated_guesser = "\Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser"; |
| 283 | - if (class_exists($deprecated_guesser) !== false){ |
|
| 283 | + if (class_exists($deprecated_guesser) !== false) { |
|
| 284 | 284 | return $deprecated_guesser::getInstance()->guess($this->getMimeType()); |
| 285 | 285 | } |
| 286 | 286 | $guesser = "\Symfony\Component\Mime\MimeTypes"; |
@@ -293,14 +293,14 @@ discard block |
||
| 293 | 293 | * |
| 294 | 294 | * @return array |
| 295 | 295 | */ |
| 296 | - public function getAttributes(){ |
|
| 296 | + public function getAttributes() { |
|
| 297 | 297 | return $this->attributes; |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | /** |
| 301 | 301 | * @return Message |
| 302 | 302 | */ |
| 303 | - public function getMessage(){ |
|
| 303 | + public function getMessage() { |
|
| 304 | 304 | return $this->oMessage; |
| 305 | 305 | } |
| 306 | 306 | |
@@ -310,8 +310,8 @@ discard block |
||
| 310 | 310 | * |
| 311 | 311 | * @return $this |
| 312 | 312 | */ |
| 313 | - public function setMask($mask){ |
|
| 314 | - if(class_exists($mask)){ |
|
| 313 | + public function setMask($mask) { |
|
| 314 | + if (class_exists($mask)) { |
|
| 315 | 315 | $this->mask = $mask; |
| 316 | 316 | } |
| 317 | 317 | |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | * |
| 324 | 324 | * @return string |
| 325 | 325 | */ |
| 326 | - public function getMask(){ |
|
| 326 | + public function getMask() { |
|
| 327 | 327 | return $this->mask; |
| 328 | 328 | } |
| 329 | 329 | |
@@ -334,9 +334,9 @@ discard block |
||
| 334 | 334 | * @return mixed |
| 335 | 335 | * @throws MaskNotFoundException |
| 336 | 336 | */ |
| 337 | - public function mask($mask = null){ |
|
| 337 | + public function mask($mask = null) { |
|
| 338 | 338 | $mask = $mask !== null ? $mask : $this->mask; |
| 339 | - if(class_exists($mask)){ |
|
| 339 | + if (class_exists($mask)) { |
|
| 340 | 340 | return new $mask($this); |
| 341 | 341 | } |
| 342 | 342 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | return null; |
| 132 | - }elseif (strtolower(substr($method, 0, 3)) === 'set') { |
|
| 132 | + } elseif (strtolower(substr($method, 0, 3)) === 'set') { |
|
| 133 | 133 | $name = Str::snake(substr($method, 3)); |
| 134 | 134 | |
| 135 | 135 | $this->attributes[$name] = array_pop($arguments); |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | |
| 222 | 222 | if (($name = $this->part->name) !== null) { |
| 223 | 223 | $this->setName($name); |
| 224 | - }elseif (($filename = $this->part->filename) !== null) { |
|
| 224 | + } elseif (($filename = $this->part->filename) !== null) { |
|
| 225 | 225 | $this->setName($filename); |
| 226 | 226 | } else { |
| 227 | 227 | $this->setName("undefined"); |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | if ($name !== null) { |
| 259 | 259 | if($decoder === 'utf-8' && extension_loaded('imap')) { |
| 260 | 260 | $this->name = \imap_utf8($name); |
| 261 | - }else{ |
|
| 261 | + } else{ |
|
| 262 | 262 | $this->name = mb_decode_mimeheader($name); |
| 263 | 263 | } |
| 264 | 264 | } |