Passed
Push — master ( 246640...836369 )
by Malte
04:09 queued 01:39
created
src/Attachment.php 1 patch
Spacing   +13 added lines, -13 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
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
         if (IMAP::ATTACHMENT_TYPE_MESSAGE == $this->part->type) {
230 230
             if ($this->part->ifdescription) {
231 231
                 $this->setName($this->part->description);
232
-            } else {
232
+            }else {
233 233
                 $this->setName($this->part->subtype);
234 234
             }
235 235
         }
@@ -255,9 +255,9 @@  discard block
 block discarded – undo
255 255
     public function setName($name) {
256 256
         $decoder = $this->config['decoder']['attachment'];
257 257
         if ($name !== null) {
258
-            if($decoder === 'utf-8' && extension_loaded('imap')) {
258
+            if ($decoder === 'utf-8' && extension_loaded('imap')) {
259 259
                 $this->name = \imap_utf8($name);
260
-            }else{
260
+            }else {
261 261
                 $this->name = mb_decode_mimeheader($name);
262 262
             }
263 263
         }
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
      *
269 269
      * @return string|null
270 270
      */
271
-    public function getMimeType(){
271
+    public function getMimeType() {
272 272
         return (new \finfo())->buffer($this->getContent(), FILEINFO_MIME_TYPE);
273 273
     }
274 274
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
      *
278 278
      * @return string|null
279 279
      */
280
-    public function getExtension(){
280
+    public function getExtension() {
281 281
         $guesser = "\Symfony\Component\Mime\MimeTypes";
282 282
         if (class_exists($guesser) !== false) {
283 283
             /** @var Symfony\Component\Mime\MimeTypes $guesser */
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
         }
287 287
 
288 288
         $deprecated_guesser = "\Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser";
289
-        if (class_exists($deprecated_guesser) !== false){
289
+        if (class_exists($deprecated_guesser) !== false) {
290 290
             /** @var \Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser $deprecated_guesser */
291 291
             return $deprecated_guesser::getInstance()->guess($this->getMimeType());
292 292
         }
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
      * @return $this
318 318
      */
319 319
     public function setMask($mask): Attachment {
320
-        if(class_exists($mask)){
320
+        if (class_exists($mask)) {
321 321
             $this->mask = $mask;
322 322
         }
323 323
 
@@ -340,9 +340,9 @@  discard block
 block discarded – undo
340 340
      * @return mixed
341 341
      * @throws MaskNotFoundException
342 342
      */
343
-    public function mask($mask = null){
343
+    public function mask($mask = null) {
344 344
         $mask = $mask !== null ? $mask : $this->mask;
345
-        if(class_exists($mask)){
345
+        if (class_exists($mask)) {
346 346
             return new $mask($this);
347 347
         }
348 348
 
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
@@ -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.