Passed
Push — master ( 5415d5...8e9570 )
by Malte
03:36
created
src/Attachment.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         $this->part_number = $part->part_number;
104 104
 
105 105
         $default_mask = $this->oMessage->getClient()->getDefaultAttachmentMask();
106
-        if($default_mask != null) {
106
+        if ($default_mask != null) {
107 107
             $this->mask = $default_mask;
108 108
         }
109 109
 
@@ -120,10 +120,10 @@  discard block
 block discarded – undo
120 120
      * @throws MethodNotFoundException
121 121
      */
122 122
     public function __call(string $method, array $arguments) {
123
-        if(strtolower(substr($method, 0, 3)) === 'get') {
123
+        if (strtolower(substr($method, 0, 3)) === 'get') {
124 124
             $name = Str::snake(substr($method, 3));
125 125
 
126
-            if(isset($this->attributes[$name])) {
126
+            if (isset($this->attributes[$name])) {
127 127
                 return $this->attributes[$name];
128 128
             }
129 129
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
      * @return mixed|null
160 160
      */
161 161
     public function __get($name) {
162
-        if(isset($this->attributes[$name])) {
162
+        if (isset($this->attributes[$name])) {
163 163
             return $this->attributes[$name];
164 164
         }
165 165
 
@@ -213,8 +213,8 @@  discard block
 block discarded – undo
213 213
 
214 214
         if (($id = $this->part->id) !== null) {
215 215
             $this->id = str_replace(['<', '>'], '', $id);
216
-        }else{
217
-            $this->id = hash("sha256", (string)microtime(true));
216
+        }else {
217
+            $this->id = hash("sha256", (string) microtime(true));
218 218
         }
219 219
 
220 220
         $this->size = $this->part->bytes;
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
         if (IMAP::ATTACHMENT_TYPE_MESSAGE == $this->part->type) {
232 232
             if ($this->part->ifdescription) {
233 233
                 $this->setName($this->part->description);
234
-            } else {
234
+            }else {
235 235
                 $this->setName($this->part->subtype);
236 236
             }
237 237
         }
@@ -257,9 +257,9 @@  discard block
 block discarded – undo
257 257
     public function setName($name) {
258 258
         $decoder = $this->config['decoder']['attachment'];
259 259
         if ($name !== null) {
260
-            if($decoder === 'utf-8' && extension_loaded('imap')) {
260
+            if ($decoder === 'utf-8' && extension_loaded('imap')) {
261 261
                 $this->name = \imap_utf8($name);
262
-            }else{
262
+            }else {
263 263
                 $this->name = mb_decode_mimeheader($name);
264 264
             }
265 265
         }
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
      *
271 271
      * @return string|null
272 272
      */
273
-    public function getMimeType(){
273
+    public function getMimeType() {
274 274
         return (new \finfo())->buffer($this->getContent(), FILEINFO_MIME_TYPE);
275 275
     }
276 276
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
      *
280 280
      * @return string|null
281 281
      */
282
-    public function getExtension(){
282
+    public function getExtension() {
283 283
         $guesser = "\Symfony\Component\Mime\MimeTypes";
284 284
         if (class_exists($guesser) !== false) {
285 285
             /** @var Symfony\Component\Mime\MimeTypes $guesser */
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
         }
289 289
 
290 290
         $deprecated_guesser = "\Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser";
291
-        if (class_exists($deprecated_guesser) !== false){
291
+        if (class_exists($deprecated_guesser) !== false) {
292 292
             /** @var \Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser $deprecated_guesser */
293 293
             return $deprecated_guesser::getInstance()->guess($this->getMimeType());
294 294
         }
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
      * @return $this
320 320
      */
321 321
     public function setMask($mask): Attachment {
322
-        if(class_exists($mask)){
322
+        if (class_exists($mask)) {
323 323
             $this->mask = $mask;
324 324
         }
325 325
 
@@ -342,9 +342,9 @@  discard block
 block discarded – undo
342 342
      * @return mixed
343 343
      * @throws MaskNotFoundException
344 344
      */
345
-    public function mask($mask = null){
345
+    public function mask($mask = null) {
346 346
         $mask = $mask !== null ? $mask : $this->mask;
347
-        if(class_exists($mask)){
347
+        if (class_exists($mask)) {
348 348
             return new $mask($this);
349 349
         }
350 350
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
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);
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 
214 214
         if (($id = $this->part->id) !== null) {
215 215
             $this->id = str_replace(['<', '>'], '', $id);
216
-        }else{
216
+        } else{
217 217
             $this->id = hash("sha256", (string)microtime(true));
218 218
         }
219 219
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
             $this->setName($filename);
225 225
         } elseif (($name = $this->part->name) !== null) {
226 226
             $this->setName($name);
227
-        }else {
227
+        } else {
228 228
             $this->setName("undefined");
229 229
         }
230 230
 
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
         if ($name !== null) {
260 260
             if($decoder === 'utf-8' && extension_loaded('imap')) {
261 261
                 $this->name = \imap_utf8($name);
262
-            }else{
262
+            } else{
263 263
                 $this->name = mb_decode_mimeheader($name);
264 264
             }
265 265
         }
Please login to merge, or discard this patch.