| @@ -77,7 +77,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | } | 
| @@ -90,7 +90,7 @@ | ||
| 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 | } |