Completed
Push — master ( 195fbd...cb8daa )
by Malte
03:04
created
src/Attachment.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         $this->part = $part;
93 93
 
94 94
         $default_mask = $this->oMessage->getClient()->getDefaultAttachmentMask();
95
-        if($default_mask != null) {
95
+        if ($default_mask != null) {
96 96
             $this->mask = $default_mask;
97 97
         }
98 98
 
@@ -109,10 +109,10 @@  discard block
 block discarded – undo
109 109
      * @throws MethodNotFoundException
110 110
      */
111 111
     public function __call($method, $arguments) {
112
-        if(strtolower(substr($method, 0, 3)) === 'get') {
112
+        if (strtolower(substr($method, 0, 3)) === 'get') {
113 113
             $name = Str::snake(substr($method, 3));
114 114
 
115
-            if(isset($this->attributes[$name])) {
115
+            if (isset($this->attributes[$name])) {
116 116
                 return $this->attributes[$name];
117 117
             }
118 118
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      * @return mixed|null
147 147
      */
148 148
     public function __get($name) {
149
-        if(isset($this->attributes[$name])) {
149
+        if (isset($this->attributes[$name])) {
150 150
             return $this->attributes[$name];
151 151
         }
152 152
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
         if (IMAP::ATTACHMENT_TYPE_MESSAGE == $this->part->type) {
216 216
             if ($this->part->ifdescription) {
217 217
                 $this->setName($this->part->description);
218
-            } else {
218
+            }else {
219 219
                 $this->setName($this->part->subtype);
220 220
             }
221 221
         }
@@ -241,9 +241,9 @@  discard block
 block discarded – undo
241 241
     public function setName($name) {
242 242
         $decoder = $this->config['decoder']['attachment'];
243 243
         if ($name !== null) {
244
-            if($decoder === 'utf-8' && extension_loaded('imap')) {
244
+            if ($decoder === 'utf-8' && extension_loaded('imap')) {
245 245
                 $this->name = \imap_utf8($name);
246
-            }else{
246
+            }else {
247 247
                 $this->name = mb_decode_mimeheader($name);
248 248
             }
249 249
         }
@@ -252,16 +252,16 @@  discard block
 block discarded – undo
252 252
     /**
253 253
      * @return string|null
254 254
      */
255
-    public function getMimeType(){
255
+    public function getMimeType() {
256 256
         return (new \finfo())->buffer($this->getContent(), FILEINFO_MIME_TYPE);
257 257
     }
258 258
 
259 259
     /**
260 260
      * @return string|null
261 261
      */
262
-    public function getExtension(){
262
+    public function getExtension() {
263 263
         $deprecated_guesser = "\Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser";
264
-        if (class_exists($deprecated_guesser) !== false){
264
+        if (class_exists($deprecated_guesser) !== false) {
265 265
             return $deprecated_guesser::getInstance()->guess($this->getMimeType());
266 266
         }
267 267
         $guesser = "\Symfony\Component\Mime\MimeTypes";
@@ -272,14 +272,14 @@  discard block
 block discarded – undo
272 272
     /**
273 273
      * @return array
274 274
      */
275
-    public function getAttributes(){
275
+    public function getAttributes() {
276 276
         return $this->attributes;
277 277
     }
278 278
 
279 279
     /**
280 280
      * @return Message
281 281
      */
282
-    public function getMessage(){
282
+    public function getMessage() {
283 283
         return $this->oMessage;
284 284
     }
285 285
 
@@ -287,8 +287,8 @@  discard block
 block discarded – undo
287 287
      * @param $mask
288 288
      * @return $this
289 289
      */
290
-    public function setMask($mask){
291
-        if(class_exists($mask)){
290
+    public function setMask($mask) {
291
+        if (class_exists($mask)) {
292 292
             $this->mask = $mask;
293 293
         }
294 294
 
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     /**
299 299
      * @return string
300 300
      */
301
-    public function getMask(){
301
+    public function getMask() {
302 302
         return $this->mask;
303 303
     }
304 304
 
@@ -309,9 +309,9 @@  discard block
 block discarded – undo
309 309
      * @return mixed
310 310
      * @throws MaskNotFoundException
311 311
      */
312
-    public function mask($mask = null){
312
+    public function mask($mask = null) {
313 313
         $mask = $mask !== null ? $mask : $this->mask;
314
-        if(class_exists($mask)){
314
+        if (class_exists($mask)) {
315 315
             return new $mask($this);
316 316
         }
317 317
 
Please login to merge, or discard this patch.