Completed
Push — master ( 03852f...872ca7 )
by Malte
05:17
created
src/Attachment.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         $this->part_number = $part->part_number;
95 95
 
96 96
         $default_mask = $this->oMessage->getClient()->getDefaultAttachmentMask();
97
-        if($default_mask != null) {
97
+        if ($default_mask != null) {
98 98
             $this->mask = $default_mask;
99 99
         }
100 100
 
@@ -111,10 +111,10 @@  discard block
 block discarded – undo
111 111
      * @throws MethodNotFoundException
112 112
      */
113 113
     public function __call($method, $arguments) {
114
-        if(strtolower(substr($method, 0, 3)) === 'get') {
114
+        if (strtolower(substr($method, 0, 3)) === 'get') {
115 115
             $name = Str::snake(substr($method, 3));
116 116
 
117
-            if(isset($this->attributes[$name])) {
117
+            if (isset($this->attributes[$name])) {
118 118
                 return $this->attributes[$name];
119 119
             }
120 120
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      * @return mixed|null
149 149
      */
150 150
     public function __get($name) {
151
-        if(isset($this->attributes[$name])) {
151
+        if (isset($this->attributes[$name])) {
152 152
             return $this->attributes[$name];
153 153
         }
154 154
 
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
         if (IMAP::ATTACHMENT_TYPE_MESSAGE == $this->part->type) {
218 218
             if ($this->part->ifdescription) {
219 219
                 $this->setName($this->part->description);
220
-            } else {
220
+            }else {
221 221
                 $this->setName($this->part->subtype);
222 222
             }
223 223
         }
@@ -243,9 +243,9 @@  discard block
 block discarded – undo
243 243
     public function setName($name) {
244 244
         $decoder = $this->config['decoder']['attachment'];
245 245
         if ($name !== null) {
246
-            if($decoder === 'utf-8' && extension_loaded('imap')) {
246
+            if ($decoder === 'utf-8' && extension_loaded('imap')) {
247 247
                 $this->name = \imap_utf8($name);
248
-            }else{
248
+            }else {
249 249
                 $this->name = mb_decode_mimeheader($name);
250 250
             }
251 251
         }
@@ -254,16 +254,16 @@  discard block
 block discarded – undo
254 254
     /**
255 255
      * @return string|null
256 256
      */
257
-    public function getMimeType(){
257
+    public function getMimeType() {
258 258
         return (new \finfo())->buffer($this->getContent(), FILEINFO_MIME_TYPE);
259 259
     }
260 260
 
261 261
     /**
262 262
      * @return string|null
263 263
      */
264
-    public function getExtension(){
264
+    public function getExtension() {
265 265
         $deprecated_guesser = "\Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser";
266
-        if (class_exists($deprecated_guesser) !== false){
266
+        if (class_exists($deprecated_guesser) !== false) {
267 267
             return $deprecated_guesser::getInstance()->guess($this->getMimeType());
268 268
         }
269 269
         $guesser = "\Symfony\Component\Mime\MimeTypes";
@@ -274,14 +274,14 @@  discard block
 block discarded – undo
274 274
     /**
275 275
      * @return array
276 276
      */
277
-    public function getAttributes(){
277
+    public function getAttributes() {
278 278
         return $this->attributes;
279 279
     }
280 280
 
281 281
     /**
282 282
      * @return Message
283 283
      */
284
-    public function getMessage(){
284
+    public function getMessage() {
285 285
         return $this->oMessage;
286 286
     }
287 287
 
@@ -289,8 +289,8 @@  discard block
 block discarded – undo
289 289
      * @param $mask
290 290
      * @return $this
291 291
      */
292
-    public function setMask($mask){
293
-        if(class_exists($mask)){
292
+    public function setMask($mask) {
293
+        if (class_exists($mask)) {
294 294
             $this->mask = $mask;
295 295
         }
296 296
 
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
     /**
301 301
      * @return string
302 302
      */
303
-    public function getMask(){
303
+    public function getMask() {
304 304
         return $this->mask;
305 305
     }
306 306
 
@@ -311,9 +311,9 @@  discard block
 block discarded – undo
311 311
      * @return mixed
312 312
      * @throws MaskNotFoundException
313 313
      */
314
-    public function mask($mask = null){
314
+    public function mask($mask = null) {
315 315
         $mask = $mask !== null ? $mask : $this->mask;
316
-        if(class_exists($mask)){
316
+        if (class_exists($mask)) {
317 317
             return new $mask($this);
318 318
         }
319 319
 
Please login to merge, or discard this patch.
src/Structure.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      * @throws MessageContentFetchingException
70 70
      * @throws InvalidMessageDateException
71 71
      */
72
-    protected function parse(){
72
+    protected function parse() {
73 73
         $this->findContentType();
74 74
         $this->parts = $this->find_parts();
75 75
     }
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
     /**
78 78
      * Determine the message content type
79 79
      */
80
-    public function findContentType(){
81
-        if(stripos($this->header->get("content-type"), 'multipart') === 0) {
80
+    public function findContentType() {
81
+        if (stripos($this->header->get("content-type"), 'multipart') === 0) {
82 82
             $this->type = IMAP::MESSAGE_TYPE_MULTIPART;
83
-        }else{
83
+        }else {
84 84
             $this->type = IMAP::MESSAGE_TYPE_TEXT;
85 85
         }
86 86
     }
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     /**
89 89
      * Determine the message content type
90 90
      */
91
-    public function getBoundary(){
91
+    public function getBoundary() {
92 92
         return $this->header->find("/boundary\=\"(.*)\"/");
93 93
     }
94 94
 
@@ -97,16 +97,16 @@  discard block
 block discarded – undo
97 97
      * @throws MessageContentFetchingException
98 98
      * @throws InvalidMessageDateException
99 99
      */
100
-    public function find_parts(){
101
-        if($this->type === IMAP::MESSAGE_TYPE_MULTIPART) {
102
-            if (($boundary = $this->getBoundary()) === null)  {
100
+    public function find_parts() {
101
+        if ($this->type === IMAP::MESSAGE_TYPE_MULTIPART) {
102
+            if (($boundary = $this->getBoundary()) === null) {
103 103
                 throw new MessageContentFetchingException("no content found", 0);
104 104
             }
105 105
 
106 106
             $raw_parts = explode($boundary, $this->raw);
107 107
             $parts = [];
108 108
             $part_number = 0;
109
-            foreach($raw_parts as $part) {
109
+            foreach ($raw_parts as $part) {
110 110
                 $part = trim(rtrim($part));
111 111
                 if ($part !== "--") {
112 112
                     $parts[] = new Part($part, null, $part_number);
Please login to merge, or discard this patch.