@@ -339,8 +339,8 @@ discard block |
||
| 339 | 339 | if ($this->streamPartEndPos === 0) { |
| 340 | 340 | return null; |
| 341 | 341 | } |
| 342 | - return $this->streamWrapperProtocol . '://' . $messageObjectId |
|
| 343 | - . '?start=' . $this->streamPartStartPos . '&end=' |
|
| 342 | + return $this->streamWrapperProtocol.'://'.$messageObjectId |
|
| 343 | + . '?start='.$this->streamPartStartPos.'&end=' |
|
| 344 | 344 | . $this->streamPartEndPos; |
| 345 | 345 | } |
| 346 | 346 | |
@@ -356,8 +356,8 @@ discard block |
||
| 356 | 356 | if ($this->streamContentEndPos === 0) { |
| 357 | 357 | return null; |
| 358 | 358 | } |
| 359 | - return $this->streamWrapperProtocol . '://' . $messageObjectId |
|
| 360 | - . '?start=' . $this->streamContentStartPos . '&end=' |
|
| 359 | + return $this->streamWrapperProtocol.'://'.$messageObjectId |
|
| 360 | + . '?start='.$this->streamContentStartPos.'&end=' |
|
| 361 | 361 | . $this->streamContentEndPos; |
| 362 | 362 | } |
| 363 | 363 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | * Sets the specified property denoted by $name to $value. |
| 168 | 168 | * |
| 169 | 169 | * @param string $name |
| 170 | - * @param mixed $value |
|
| 170 | + * @param string $value |
|
| 171 | 171 | */ |
| 172 | 172 | public function setProperty($name, $value) |
| 173 | 173 | { |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | * Returns the value of the property with the given $name. |
| 179 | 179 | * |
| 180 | 180 | * @param string $name |
| 181 | - * @return mixed |
|
| 181 | + * @return null|string |
|
| 182 | 182 | */ |
| 183 | 183 | public function getProperty($name) |
| 184 | 184 | { |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | /** |
| 192 | 192 | * Registers the passed PartBuilder as a child of the current PartBuilder. |
| 193 | 193 | * |
| 194 | - * @param \ZBateson\MailMimeParser\Message\PartBuilder $partBuilder |
|
| 194 | + * @param PartBuilder $partBuilder |
|
| 195 | 195 | */ |
| 196 | 196 | public function addChild(PartBuilder $partBuilder) |
| 197 | 197 | { |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | /** |
| 206 | 206 | * Returns all children PartBuilder objects. |
| 207 | 207 | * |
| 208 | - * @return \ZBateson\MailMimeParser\Message\PartBuilder[] |
|
| 208 | + * @return PartBuilder[] |
|
| 209 | 209 | */ |
| 210 | 210 | public function getChildren() |
| 211 | 211 | { |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | * set to true (i.e. this isn't a discardable part following the parent's |
| 346 | 346 | * end boundary line). |
| 347 | 347 | * |
| 348 | - * @return booelan |
|
| 348 | + * @return boolean |
|
| 349 | 349 | */ |
| 350 | 350 | public function canHaveHeaders() |
| 351 | 351 | { |
@@ -181,7 +181,7 @@ |
||
| 181 | 181 | ); |
| 182 | 182 | return array_values(array_filter( |
| 183 | 183 | $parts, |
| 184 | - function ($part) { |
|
| 184 | + function($part) { |
|
| 185 | 185 | return !( |
| 186 | 186 | $part->isTextPart() |
| 187 | 187 | && $part->getContentDisposition() === 'inline' |
@@ -167,7 +167,7 @@ |
||
| 167 | 167 | $this->contentHandle, |
| 168 | 168 | $this->charsetConversionFilter, |
| 169 | 169 | STREAM_FILTER_READ, |
| 170 | - [ 'from' => $fromCharset, 'to' => $toCharset ] |
|
| 170 | + ['from' => $fromCharset, 'to' => $toCharset] |
|
| 171 | 171 | ); |
| 172 | 172 | } |
| 173 | 173 | $this->charset['from'] = $fromCharset; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | $pbChildren = $partBuilder->getChildren(); |
| 82 | 82 | if (!empty($pbChildren)) { |
| 83 | - $this->children = array_map(function ($child) use ($messageObjectId) { |
|
| 83 | + $this->children = array_map(function($child) use ($messageObjectId) { |
|
| 84 | 84 | $childPart = $child->createMessagePart($messageObjectId); |
| 85 | 85 | $childPart->parent = $this; |
| 86 | 86 | return $childPart; |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | protected function getAllNonFilteredParts() |
| 100 | 100 | { |
| 101 | - $parts = [ $this ]; |
|
| 101 | + $parts = [$this]; |
|
| 102 | 102 | foreach ($this->children as $part) { |
| 103 | 103 | if ($part instanceof MimePart) { |
| 104 | 104 | $parts = array_merge( |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | if (!empty($filter)) { |
| 150 | 150 | return array_values(array_filter( |
| 151 | 151 | $parts, |
| 152 | - [ $filter, 'filter' ] |
|
| 152 | + [$filter, 'filter'] |
|
| 153 | 153 | )); |
| 154 | 154 | } |
| 155 | 155 | return $parts; |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | public function getChildParts(PartFilter $filter = null) |
| 198 | 198 | { |
| 199 | 199 | if ($filter !== null) { |
| 200 | - return array_values(array_filter($this->children, [ $filter, 'filter' ])); |
|
| 200 | + return array_values(array_filter($this->children, [$filter, 'filter'])); |
|
| 201 | 201 | } |
| 202 | 202 | return $this->children; |
| 203 | 203 | } |
@@ -278,9 +278,9 @@ discard block |
||
| 278 | 278 | |
| 279 | 279 | // maps |
| 280 | 280 | protected $mappedRequestedCharsets = [ |
| 281 | - 'UTF-8' => [ true, 'UTF-8' ], |
|
| 282 | - 'US-ASCII' => [ true, 'US-ASCII' ], |
|
| 283 | - 'ISO-8859-1' => [ true, 'ISO-8859-1' ], |
|
| 281 | + 'UTF-8' => [true, 'UTF-8'], |
|
| 282 | + 'US-ASCII' => [true, 'US-ASCII'], |
|
| 283 | + 'ISO-8859-1' => [true, 'ISO-8859-1'], |
|
| 284 | 284 | ]; |
| 285 | 285 | |
| 286 | 286 | /** |
@@ -307,14 +307,14 @@ discard block |
||
| 307 | 307 | if ($str !== '') { |
| 308 | 308 | if ($fromMbSupported && !$toMbSupported) { |
| 309 | 309 | $str = mb_convert_encoding($str, 'UTF-8', $from); |
| 310 | - return iconv('UTF-8', $to . '//TRANSLIT//IGNORE', $str); |
|
| 310 | + return iconv('UTF-8', $to.'//TRANSLIT//IGNORE', $str); |
|
| 311 | 311 | } elseif (!$fromMbSupported && $toMbSupported) { |
| 312 | 312 | $str = iconv($from, 'UTF-8//TRANSLIT//IGNORE', $str); |
| 313 | 313 | return mb_convert_encoding($str, $to, 'UTF-8'); |
| 314 | 314 | } elseif ($fromMbSupported && $toMbSupported) { |
| 315 | 315 | return mb_convert_encoding($str, $to, $from); |
| 316 | 316 | } |
| 317 | - return iconv($from, $to . '//TRANSLIT//IGNORE', $str); |
|
| 317 | + return iconv($from, $to.'//TRANSLIT//IGNORE', $str); |
|
| 318 | 318 | } |
| 319 | 319 | return $str; |
| 320 | 320 | } |
@@ -158,8 +158,8 @@ |
||
| 158 | 158 | ksort($parts); |
| 159 | 159 | return array_reduce( |
| 160 | 160 | $parts, |
| 161 | - function ($carry, $item) { |
|
| 162 | - return $carry . $item; |
|
| 161 | + function($carry, $item) { |
|
| 162 | + return $carry.$item; |
|
| 163 | 163 | }, |
| 164 | 164 | '' |
| 165 | 165 | ); |