@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $boundary = $part->getHeaderParameter('Content-Type', 'boundary'); |
136 | 136 | if ($boundary === null) { |
137 | 137 | return array_map( |
138 | - function ($child) { |
|
138 | + function($child) { |
|
139 | 139 | return $child->getStream(); |
140 | 140 | }, |
141 | 141 | $part->getChildParts() |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $content = Psr7\stream_for(); |
166 | 166 | $this->writePartContentTo($content); |
167 | 167 | $content->rewind(); |
168 | - $streams = [ $this->streamFactory->newHeaderStream($this->part), $content ]; |
|
168 | + $streams = [$this->streamFactory->newHeaderStream($this->part), $content]; |
|
169 | 169 | |
170 | 170 | /** |
171 | 171 | * @var ParentHeaderPart |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | public function getUniqueBoundary($mimeType) |
56 | 56 | { |
57 | 57 | $type = ltrim(strtoupper(preg_replace('/^(multipart\/(.{3}).*|.*)$/i', '$2-', $mimeType)), '-'); |
58 | - return uniqid('----=MMP-' . $type . '.', true); |
|
58 | + return uniqid('----=MMP-'.$type.'.', true); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $part->setRawHeader( |
71 | 71 | 'Content-Type', |
72 | 72 | "$mimeType;\r\n\tboundary=\"" |
73 | - . $this->getUniqueBoundary($mimeType) . '"' |
|
73 | + . $this->getUniqueBoundary($mimeType).'"' |
|
74 | 74 | ); |
75 | 75 | } |
76 | 76 | |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | public function createAndAddPartForAttachment(Message $message, $resource, $mimeType, $disposition, $filename = null) |
343 | 343 | { |
344 | 344 | if ($filename === null) { |
345 | - $filename = 'file' . uniqid(); |
|
345 | + $filename = 'file'.uniqid(); |
|
346 | 346 | } |
347 | 347 | |
348 | 348 | $safe = iconv('UTF-8', 'US-ASCII//translit//ignore', $filename); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | public function add($name, $value) |
126 | 126 | { |
127 | 127 | $s = $this->getNormalizedHeaderName($name); |
128 | - $this->headers[$this->nextIndex] = [ $name, $value ]; |
|
128 | + $this->headers[$this->nextIndex] = [$name, $value]; |
|
129 | 129 | $this->headerObjects[$this->nextIndex] = null; |
130 | 130 | if (!isset($this->headerMap[$s])) { |
131 | 131 | $this->headerMap[$s] = []; |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | return; |
143 | 143 | } |
144 | 144 | $i = $this->headerMap[$s][$offset]; |
145 | - $this->headers[$i] = [ $name, $value ]; |
|
145 | + $this->headers[$i] = [$name, $value]; |
|
146 | 146 | $this->headerObjects[$i] = null; |
147 | 147 | } |
148 | 148 |
@@ -54,9 +54,9 @@ |
||
54 | 54 | return $this->part->getRawHeaderIterator(); |
55 | 55 | } elseif ($this->part->getParent() !== null && $this->part->getParent()->isMime()) { |
56 | 56 | return new ArrayIterator([ |
57 | - [ 'Content-Type', $this->part->getContentType() ], |
|
58 | - [ 'Content-Disposition', $this->part->getContentDisposition() ], |
|
59 | - [ 'Content-Transfer-Encoding', $this->part->getContentTransferEncoding() ] |
|
57 | + ['Content-Type', $this->part->getContentType()], |
|
58 | + ['Content-Disposition', $this->part->getContentDisposition()], |
|
59 | + ['Content-Transfer-Encoding', $this->part->getContentTransferEncoding()] |
|
60 | 60 | ]); |
61 | 61 | } |
62 | 62 | return new ArrayIterator(); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | { |
147 | 147 | return $this->getInstance( |
148 | 148 | 'partFilterFactory', |
149 | - __NAMESPACE__ . '\Message\PartFilterFactory' |
|
149 | + __NAMESPACE__.'\Message\PartFilterFactory' |
|
150 | 150 | ); |
151 | 151 | } |
152 | 152 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | { |
195 | 195 | return $this->getInstance( |
196 | 196 | 'streamFactory', |
197 | - __NAMESPACE__ . '\Stream\StreamFactory' |
|
197 | + __NAMESPACE__.'\Stream\StreamFactory' |
|
198 | 198 | ); |
199 | 199 | } |
200 | 200 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | } |
208 | 208 | return $this->getInstance( |
209 | 209 | 'partStreamFilterManagerFactory', |
210 | - __NAMESPACE__ . '\Message\Part\PartStreamFilterManagerFactory' |
|
210 | + __NAMESPACE__.'\Message\Part\PartStreamFilterManagerFactory' |
|
211 | 211 | ); |
212 | 212 | } |
213 | 213 |
@@ -88,7 +88,7 @@ |
||
88 | 88 | protected function getTokenSplitPattern() |
89 | 89 | { |
90 | 90 | $sChars = implode('|', $this->getAllTokenSeparators()); |
91 | - return '~(' . $sChars . ')~'; |
|
91 | + return '~('.$sChars.')~'; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | $strValue = $ehloName; |
111 | 111 | if ($commentPart !== null && $this->matchHostPart($commentPart->getComment(), $hostname, $address)) { |
112 | - $strValue .= ' (' . $commentPart->getComment() . ')'; |
|
112 | + $strValue .= ' ('.$commentPart->getComment().')'; |
|
113 | 113 | $commentPart = null; |
114 | 114 | } |
115 | 115 | |
@@ -120,6 +120,6 @@ discard block |
||
120 | 120 | $hostname, |
121 | 121 | $address |
122 | 122 | ); |
123 | - return array_filter([ $domainPart, $commentPart ]); |
|
123 | + return array_filter([$domainPart, $commentPart]); |
|
124 | 124 | } |
125 | 125 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | protected function getSubConsumers() |
78 | 78 | { |
79 | - return [ $this->consumerService->getCommentConsumer() ]; |
|
79 | + return [$this->consumerService->getCommentConsumer()]; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | protected function isStartToken($token) |
90 | 90 | { |
91 | - $pattern = '/^\s*(' . preg_quote($this->getPartName(), '/') . ')\s*$/i'; |
|
91 | + $pattern = '/^\s*('.preg_quote($this->getPartName(), '/').')\s*$/i'; |
|
92 | 92 | return (preg_match($pattern, $token) === 1); |
93 | 93 | } |
94 | 94 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | { |
124 | 124 | return [ |
125 | 125 | '\s+', |
126 | - '[\A\s]*(?i)' . preg_quote($this->getPartName(), '/') . '(?-i)\s+' |
|
126 | + '[\A\s]*(?i)'.preg_quote($this->getPartName(), '/').'(?-i)\s+' |
|
127 | 127 | ]; |
128 | 128 | } |
129 | 129 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | foreach ($filtered as $part) { |
146 | 146 | if ($part instanceof CommentPart) { |
147 | 147 | $ret[] = $part; |
148 | - continue; // getValue() is empty anyway, but for clarity... |
|
148 | + continue; // getValue() is empty anyway, but for clarity... |
|
149 | 149 | } |
150 | 150 | $strValue .= $part->getValue(); |
151 | 151 | } |
@@ -96,7 +96,7 @@ |
||
96 | 96 | */ |
97 | 97 | protected function processParts(array $parts) |
98 | 98 | { |
99 | - return array_values(array_filter($parts, function ($part) { |
|
99 | + return array_values(array_filter($parts, function($part) { |
|
100 | 100 | if (empty($part) || $part instanceof CommentPart) { |
101 | 101 | return false; |
102 | 102 | } |