Passed
Push — master ( 5748cf...94bf93 )
by Malte
03:13 queued 41s
created
src/Structure.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      * @throws MessageContentFetchingException
78 78
      * @throws InvalidMessageDateException
79 79
      */
80
-    protected function parse(){
80
+    protected function parse() {
81 81
         $this->findContentType();
82 82
         $this->parts = $this->find_parts();
83 83
     }
@@ -85,12 +85,12 @@  discard block
 block discarded – undo
85 85
     /**
86 86
      * Determine the message content type
87 87
      */
88
-    public function findContentType(){
88
+    public function findContentType() {
89 89
         $content_type = $this->header->get("content_type");
90 90
         $content_type = (is_array($content_type)) ? implode(' ', $content_type) : $content_type;
91
-        if($content_type && stripos($content_type, 'multipart') === 0) {
91
+        if ($content_type && stripos($content_type, 'multipart') === 0) {
92 92
             $this->type = IMAP::MESSAGE_TYPE_MULTIPART;
93
-        }else{
93
+        }else {
94 94
             $this->type = IMAP::MESSAGE_TYPE_TEXT;
95 95
         }
96 96
     }
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
      * @throws InvalidMessageDateException
128 128
      */
129 129
     private function detectParts(string $boundary, string $context, int $part_number = 0): array {
130
-        $base_parts = explode( $boundary, $context);
130
+        $base_parts = explode($boundary, $context);
131 131
         $final_parts = [];
132
-        foreach($base_parts as $ctx) {
132
+        foreach ($base_parts as $ctx) {
133 133
             $ctx = substr($ctx, 2);
134 134
             if ($ctx !== "--" && $ctx != "") {
135 135
                 $parts = $this->parsePart($ctx, $part_number);
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
      * @throws InvalidMessageDateException
152 152
      */
153 153
     public function find_parts(): array {
154
-        if($this->type === IMAP::MESSAGE_TYPE_MULTIPART) {
155
-            if (($boundary = $this->header->getBoundary()) === null)  {
154
+        if ($this->type === IMAP::MESSAGE_TYPE_MULTIPART) {
155
+            if (($boundary = $this->header->getBoundary()) === null) {
156 156
                 throw new MessageContentFetchingException("no content found", 0);
157 157
             }
158 158
 
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
      * @return string|null
169 169
      * @Depricated since version 2.4.4
170 170
      */
171
-    public function getBoundary(){
171
+    public function getBoundary() {
172 172
         return $this->header->getBoundary();
173 173
     }
174 174
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
         $content_type = (is_array($content_type)) ? implode(' ', $content_type) : $content_type;
91 91
         if($content_type && stripos($content_type, 'multipart') === 0) {
92 92
             $this->type = IMAP::MESSAGE_TYPE_MULTIPART;
93
-        }else{
93
+        } else{
94 94
             $this->type = IMAP::MESSAGE_TYPE_TEXT;
95 95
         }
96 96
     }
Please login to merge, or discard this patch.
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.