@@ -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(stripos($content_type, 'multipart') === 0) { |
|
91 | + if (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 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @return Part[] |
104 | 104 | * @throws InvalidMessageDateException |
105 | 105 | */ |
106 | - private function parsePart($context, $part_number = 0){ |
|
106 | + private function parsePart($context, $part_number = 0) { |
|
107 | 107 | $body = $context; |
108 | 108 | while (($pos = strpos($body, "\r\n")) > 0) { |
109 | 109 | $body = substr($body, $pos + 2); |
@@ -126,10 +126,10 @@ discard block |
||
126 | 126 | * @return array |
127 | 127 | * @throws InvalidMessageDateException |
128 | 128 | */ |
129 | - private function detectParts($boundary, $context, $part_number = 0){ |
|
130 | - $base_parts = explode( $boundary, $context); |
|
129 | + private function detectParts($boundary, $context, $part_number = 0) { |
|
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); |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | * @throws MessageContentFetchingException |
151 | 151 | * @throws InvalidMessageDateException |
152 | 152 | */ |
153 | - public function find_parts(){ |
|
154 | - if($this->type === IMAP::MESSAGE_TYPE_MULTIPART) { |
|
155 | - if (($boundary = $this->header->getBoundary()) === null) { |
|
153 | + public function find_parts() { |
|
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 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @return string |
56 | 56 | */ |
57 | - public function toString(){ |
|
57 | + public function toString() { |
|
58 | 58 | return $this->__toString(); |
59 | 59 | } |
60 | 60 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * |
64 | 64 | * @return array |
65 | 65 | */ |
66 | - public function __serialize(){ |
|
66 | + public function __serialize() { |
|
67 | 67 | return $this->values; |
68 | 68 | } |
69 | 69 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * |
73 | 73 | * @return array |
74 | 74 | */ |
75 | - public function toArray(){ |
|
75 | + public function toArray() { |
|
76 | 76 | return $this->__serialize(); |
77 | 77 | } |
78 | 78 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | public function offsetSet($key, $value) { |
107 | 107 | if (is_null($key)) { |
108 | 108 | $this->values[] = $value; |
109 | - } else { |
|
109 | + }else { |
|
110 | 110 | $this->values[$key] = $value; |
111 | 111 | } |
112 | 112 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | if ($this->contains($value) === false) { |
181 | 181 | $this->values[] = $value; |
182 | 182 | } |
183 | - }else{ |
|
183 | + }else { |
|
184 | 184 | $this->values[] = $value; |
185 | 185 | } |
186 | 186 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | * |
192 | 192 | * @return Attribute |
193 | 193 | */ |
194 | - public function setName($name){ |
|
194 | + public function setName($name) { |
|
195 | 195 | $this->name = $name; |
196 | 196 | |
197 | 197 | return $this; |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | * |
203 | 203 | * @return string |
204 | 204 | */ |
205 | - public function getName(){ |
|
205 | + public function getName() { |
|
206 | 206 | return $this->name; |
207 | 207 | } |
208 | 208 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | * |
212 | 212 | * @return array |
213 | 213 | */ |
214 | - public function get(){ |
|
214 | + public function get() { |
|
215 | 215 | return $this->values; |
216 | 216 | } |
217 | 217 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | * |
221 | 221 | * @return array |
222 | 222 | */ |
223 | - public function all(){ |
|
223 | + public function all() { |
|
224 | 224 | return $this->get(); |
225 | 225 | } |
226 | 226 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | * |
230 | 230 | * @return mixed|null |
231 | 231 | */ |
232 | - public function first(){ |
|
232 | + public function first() { |
|
233 | 233 | if (count($this->values) > 0) { |
234 | 234 | return $this->values[0]; |
235 | 235 | } |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | * |
242 | 242 | * @return mixed|null |
243 | 243 | */ |
244 | - public function last(){ |
|
244 | + public function last() { |
|
245 | 245 | $cnt = count($this->values); |
246 | 246 | if ($cnt > 0) { |
247 | 247 | return $this->values[$cnt - 1]; |