@@ -100,9 +100,9 @@ |
||
100 | 100 | foreach ($parts as $part) { |
101 | 101 | // order is important here - CommentPart extends LiteralPart |
102 | 102 | if ($part instanceof CommentPart) { |
103 | - $comment .= '(' . $part->getComment() . ')'; |
|
103 | + $comment .= '('.$part->getComment().')'; |
|
104 | 104 | } elseif ($part instanceof LiteralPart) { |
105 | - $comment .= '"' . \str_replace('(["\\])', '\$1', $part->getValue()) . '"'; |
|
105 | + $comment .= '"'.\str_replace('(["\\])', '\$1', $part->getValue()).'"'; |
|
106 | 106 | } else { |
107 | 107 | $comment .= $part->getValue(); |
108 | 108 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @param HeaderPart[] $parts |
86 | 86 | * @param HeaderPart[] $retParts |
87 | 87 | */ |
88 | - private function addSpaceToRetParts(array $parts, array &$retParts, int $curIndex, HeaderPart &$spacePart, HeaderPart $lastPart) : self |
|
88 | + private function addSpaceToRetParts(array $parts, array &$retParts, int $curIndex, HeaderPart & $spacePart, HeaderPart $lastPart) : self |
|
89 | 89 | { |
90 | 90 | $nextPart = $parts[$curIndex]; |
91 | 91 | if ($this->shouldAddSpace($nextPart, $lastPart)) { |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | * @param HeaderPart[] $retParts |
107 | 107 | * @param HeaderPart $spacePart |
108 | 108 | */ |
109 | - private function addSpaces(array $parts, array &$retParts, int $curIndex, ?HeaderPart &$spacePart = null) : self |
|
109 | + private function addSpaces(array $parts, array &$retParts, int $curIndex, ?HeaderPart & $spacePart = null) : self |
|
110 | 110 | { |
111 | 111 | $lastPart = \end($retParts); |
112 | 112 | if ($spacePart !== null && $curIndex < \count($parts) && $parts[$curIndex]->getValue() !== '' && $lastPart !== false) { |
@@ -78,7 +78,7 @@ |
||
78 | 78 | foreach ($parts as $p) { |
79 | 79 | $val = $p->getValue(); |
80 | 80 | if ((($p instanceof LiteralPart) && !($p instanceof CommentPart)) && $val !== '') { |
81 | - $val = '"' . \preg_replace('/(["\\\])/', '\\\$1', $val) . '"'; |
|
81 | + $val = '"'.\preg_replace('/(["\\\])/', '\\\$1', $val).'"'; |
|
82 | 82 | } else { |
83 | 83 | $val = \preg_replace('/\s+/', '', $val); |
84 | 84 | } |
@@ -87,7 +87,7 @@ |
||
87 | 87 | protected function getTokenSplitPattern() : string |
88 | 88 | { |
89 | 89 | $sChars = \implode('|', $this->getAllTokenSeparators()); |
90 | - return '~(' . $sChars . ')~'; |
|
90 | + return '~('.$sChars.')~'; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -52,7 +52,7 @@ |
||
52 | 52 | { |
53 | 53 | $sChars = \implode('|', $this->getAllTokenSeparators()); |
54 | 54 | $mimePartPattern = MimeLiteralPart::MIME_PART_PATTERN_NO_QUOTES; |
55 | - return '~(' . $mimePartPattern . '|\\\\.|' . $sChars . ')~'; |
|
55 | + return '~('.$mimePartPattern.'|\\\\.|'.$sChars.')~'; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -87,7 +87,7 @@ |
||
87 | 87 | protected function getTokenSplitPattern() : string |
88 | 88 | { |
89 | 89 | $sChars = \implode('|', $this->getAllTokenSeparators()); |
90 | - return '~(' . $sChars . ')~'; |
|
90 | + return '~('.$sChars.')~'; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -65,10 +65,10 @@ |
||
65 | 65 | */ |
66 | 66 | protected function processParts(array $parts) : array |
67 | 67 | { |
68 | - $id = \array_reduce(\array_filter($parts), function ($c, $p) { |
|
69 | - return $c . $p->getValue(); |
|
68 | + $id = \array_reduce(\array_filter($parts), function($c, $p) { |
|
69 | + return $c.$p->getValue(); |
|
70 | 70 | }, ''); |
71 | - return array_merge([$this->partFactory->newLiteralPart($id)], \array_values(\array_filter($parts, function ($p) { |
|
71 | + return array_merge([$this->partFactory->newLiteralPart($id)], \array_values(\array_filter($parts, function($p) { |
|
72 | 72 | return ($p instanceof CommentPart); |
73 | 73 | }))); |
74 | 74 | } |
@@ -71,12 +71,12 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function __invoke(string $value) : array |
73 | 73 | { |
74 | - $this->getLogger()->debug('Starting ${class} for "${value}"', [ 'class' => static::class, 'value' => $value ]); |
|
74 | + $this->getLogger()->debug('Starting ${class} for "${value}"', ['class' => static::class, 'value' => $value]); |
|
75 | 75 | if ($value !== '') { |
76 | 76 | $parts = $this->parseRawValue($value); |
77 | 77 | $this->getLogger()->debug( |
78 | 78 | 'Ending ${class} for "${value}": parsed into ${cnt} header part objects', |
79 | - [ 'class' => static::class, 'value' => $value, 'cnt' => count($parts) ] |
|
79 | + ['class' => static::class, 'value' => $value, 'cnt' => count($parts)] |
|
80 | 80 | ); |
81 | 81 | return $parts; |
82 | 82 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | { |
177 | 177 | $sChars = \implode('|', $this->getAllTokenSeparators()); |
178 | 178 | $mimePartPattern = MimeLiteralPart::MIME_PART_PATTERN; |
179 | - return '~(' . $mimePartPattern . '|\\\\.|' . $sChars . ')~'; |
|
179 | + return '~('.$mimePartPattern.'|\\\\.|'.$sChars.')~'; |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | $this->tokenSplitPattern = $this->getTokenSplitPattern(); |
196 | 196 | $this->getLogger()->debug( |
197 | 197 | 'Configuring ${class} with token split pattern: ${pattern}', |
198 | - [ 'class' => static::class, 'pattern' => $this->tokenSplitPattern] |
|
198 | + ['class' => static::class, 'pattern' => $this->tokenSplitPattern] |
|
199 | 199 | ); |
200 | 200 | } |
201 | 201 | return \preg_split( |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | if ($consumer->isStartToken($token)) { |
267 | 267 | $this->getLogger()->debug( |
268 | 268 | 'Token: "${value}" in ${class} starting sub-consumer ${consumer}', |
269 | - [ 'value' => $token, 'class' => static::class, 'consumer' => get_class($consumer) ] |
|
269 | + ['value' => $token, 'class' => static::class, 'consumer' => get_class($consumer)] |
|
270 | 270 | ); |
271 | 271 | $this->advanceToNextToken($tokens, true); |
272 | 272 | return $consumer->parseTokensIntoParts($tokens); |
@@ -113,7 +113,7 @@ |
||
113 | 113 | } elseif ($part instanceof AddressPart) { |
114 | 114 | return [$this->partFactory->newAddressPart($strName, $part->getEmail())]; |
115 | 115 | } elseif ((($part instanceof LiteralPart) && !($part instanceof CommentPart)) && $part->getValue() !== '') { |
116 | - $strEmail .= '"' . \preg_replace('/(["\\\])/', '\\\$1', $part->getValue()) . '"'; |
|
116 | + $strEmail .= '"'.\preg_replace('/(["\\\])/', '\\\$1', $part->getValue()).'"'; |
|
117 | 117 | } else { |
118 | 118 | $strEmail .= \preg_replace('/\s+/', '', $part->getValue()); |
119 | 119 | } |