@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function getTokenSeparators() |
| 61 | 61 | { |
| 62 | - return [ '<', '>', ',', ';', '\s+' ]; |
|
| 62 | + return ['<', '>', ',', ';', '\s+']; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
@@ -141,6 +141,6 @@ discard block |
||
| 141 | 141 | } |
| 142 | 142 | $this->processSinglePart($part, $strName, $strValue); |
| 143 | 143 | } |
| 144 | - return [ $this->partFactory->newAddressPart($strName, $strValue) ]; |
|
| 144 | + return [$this->partFactory->newAddressPart($strName, $strValue)]; |
|
| 145 | 145 | } |
| 146 | 146 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | protected function getTokenSeparators() |
| 42 | 42 | { |
| 43 | - return [ '\(', '\)' ]; |
|
| 43 | + return ['\(', '\)']; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
@@ -109,13 +109,13 @@ discard block |
||
| 109 | 109 | foreach ($parts as $part) { |
| 110 | 110 | // order is important here - CommentPart extends LiteralPart |
| 111 | 111 | if ($part instanceof CommentPart) { |
| 112 | - $comment .= '(' . $part->getComment() . ')'; |
|
| 112 | + $comment .= '('.$part->getComment().')'; |
|
| 113 | 113 | } elseif ($part instanceof LiteralPart) { |
| 114 | - $comment .= '"' . $part->getValue() . '"'; |
|
| 114 | + $comment .= '"'.$part->getValue().'"'; |
|
| 115 | 115 | } else { |
| 116 | 116 | $comment .= $part->getValue(); |
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | - return [ $this->partFactory->newCommentPart($comment) ]; |
|
| 119 | + return [$this->partFactory->newCommentPart($comment)]; |
|
| 120 | 120 | } |
| 121 | 121 | } |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | public function getTokenSeparators() |
| 24 | 24 | { |
| 25 | - return [ '\s+', '<', '>' ]; |
|
| 25 | + return ['\s+', '<', '>']; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | { |
| 164 | 164 | $sChars = implode('|', $this->getAllTokenSeparators()); |
| 165 | 165 | $mimePartPattern = MimeLiteralPart::MIME_PART_PATTERN; |
| 166 | - return '~(' . $mimePartPattern . '|\\\\.|' . $sChars . ')~'; |
|
| 166 | + return '~('.$mimePartPattern.'|\\\\.|'.$sChars.')~'; |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | /** |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | return $consumer->parseTokensIntoParts($tokens); |
| 250 | 250 | } |
| 251 | 251 | } |
| 252 | - return [ $this->getPartForToken($token, false) ]; |
|
| 252 | + return [$this->getPartForToken($token, false)]; |
|
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | /** |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | { |
| 267 | 267 | $token = $tokens->current(); |
| 268 | 268 | if (strlen($token) === 2 && $token[0] === '\\') { |
| 269 | - return [ $this->getPartForToken(substr($token, 1), true) ]; |
|
| 269 | + return [$this->getPartForToken(substr($token, 1), true)]; |
|
| 270 | 270 | } |
| 271 | 271 | return $this->getConsumerTokenParts($tokens); |
| 272 | 272 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function getTokenSeparators() |
| 36 | 36 | { |
| 37 | - return [ ':', ';' ]; |
|
| 37 | + return [':', ';']; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -79,6 +79,6 @@ discard block |
||
| 79 | 79 | $emails[] = $part; |
| 80 | 80 | } |
| 81 | 81 | $group = $this->partFactory->newAddressGroupPart($emails); |
| 82 | - return [ $group ]; |
|
| 82 | + return [$group]; |
|
| 83 | 83 | } |
| 84 | 84 | } |
@@ -69,9 +69,9 @@ |
||
| 69 | 69 | return $this->part->getRawHeaderIterator(); |
| 70 | 70 | } elseif ($this->part->getParent() !== null && $this->part->getParent()->isMime()) { |
| 71 | 71 | return new ArrayIterator([ |
| 72 | - [ HeaderConsts::CONTENT_TYPE, $this->part->getContentType() ], |
|
| 73 | - [ HeaderConsts::CONTENT_DISPOSITION, $this->part->getContentDisposition() ], |
|
| 74 | - [ HeaderConsts::CONTENT_TRANSFER_ENCODING, $this->part->getContentTransferEncoding() ] |
|
| 72 | + [HeaderConsts::CONTENT_TYPE, $this->part->getContentType()], |
|
| 73 | + [HeaderConsts::CONTENT_DISPOSITION, $this->part->getContentDisposition()], |
|
| 74 | + [HeaderConsts::CONTENT_TRANSFER_ENCODING, $this->part->getContentTransferEncoding()] |
|
| 75 | 75 | ]); |
| 76 | 76 | } |
| 77 | 77 | return new ArrayIterator(); |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | public function __construct(MimeParser $mimeParser, NonMimeParser $nonMimeParser) |
| 24 | 24 | { |
| 25 | - $this->parsers = [ $mimeParser, $nonMimeParser ]; |
|
| 25 | + $this->parsers = [$mimeParser, $nonMimeParser]; |
|
| 26 | 26 | $mimeParser->setParserManager($this); |
| 27 | 27 | $nonMimeParser->setParserManager($this); |
| 28 | 28 | } |
@@ -54,8 +54,7 @@ discard block |
||
| 54 | 54 | foreach ($this->parsers as $parser) { |
| 55 | 55 | if ($parser->canParse($partBuilder)) { |
| 56 | 56 | $factory = ($partBuilder->getParent() === null) ? |
| 57 | - $parser->getParserMessageProxyFactory() : |
|
| 58 | - $parser->getParserPartProxyFactory(); |
|
| 57 | + $parser->getParserMessageProxyFactory() : $parser->getParserPartProxyFactory(); |
|
| 59 | 58 | return $factory->newInstance($partBuilder, $parser); |
| 60 | 59 | } |
| 61 | 60 | } |
@@ -135,7 +135,7 @@ |
||
| 135 | 135 | { |
| 136 | 136 | $stream = Utils::streamFor( |
| 137 | 137 | $resource, |
| 138 | - [ 'metadata' => [ 'mmp-detached-stream' => ($attached !== true) ] ] |
|
| 138 | + ['metadata' => ['mmp-detached-stream' => ($attached !== true)]] |
|
| 139 | 139 | ); |
| 140 | 140 | if (!$stream->isSeekable()) { |
| 141 | 141 | $stream = new CachingStream($stream); |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | $boundary = $part->getHeaderParameter(HeaderConsts::CONTENT_TYPE, 'boundary'); |
| 159 | 159 | if ($boundary === null) { |
| 160 | 160 | return array_map( |
| 161 | - function ($child) { |
|
| 161 | + function($child) { |
|
| 162 | 162 | return $child->getStream(); |
| 163 | 163 | }, |
| 164 | 164 | $part->getChildParts() |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $content = Psr7\Utils::streamFor(); |
| 189 | 189 | $this->writePartContentTo($content); |
| 190 | 190 | $content->rewind(); |
| 191 | - $streams = [ $this->streamFactory->newHeaderStream($this->part), $content ]; |
|
| 191 | + $streams = [$this->streamFactory->newHeaderStream($this->part), $content]; |
|
| 192 | 192 | |
| 193 | 193 | if ($this->part instanceof IMimePart && $this->part->getChildCount() > 0) { |
| 194 | 194 | $streams = array_merge($streams, $this->getBoundaryAndChildStreams($this->part)); |