@@ -65,7 +65,7 @@ |
||
| 65 | 65 | * @param resource $handle |
| 66 | 66 | * @return string|false the read line or false on EOF or on error. |
| 67 | 67 | */ |
| 68 | - public static function readLine($handle) : string|false |
|
| 68 | + public static function readLine($handle) : string | false |
|
| 69 | 69 | { |
| 70 | 70 | $size = 4096; |
| 71 | 71 | $ret = $line = \fgets($handle, $size); |
@@ -119,8 +119,7 @@ discard block |
||
| 119 | 119 | public function getStream() : StreamInterface |
| 120 | 120 | { |
| 121 | 121 | return ($this->messageStream === null && $this->parent !== null) ? |
| 122 | - $this->parent->getStream() : |
|
| 123 | - $this->messageStream; |
|
| 122 | + $this->parent->getStream() : $this->messageStream; |
|
| 124 | 123 | } |
| 125 | 124 | |
| 126 | 125 | /** |
@@ -132,8 +131,7 @@ discard block |
||
| 132 | 131 | public function getMessageResourceHandle() : mixed |
| 133 | 132 | { |
| 134 | 133 | return ($this->messageHandle === null && $this->parent !== null) ? |
| 135 | - $this->parent->getMessageResourceHandle() : |
|
| 136 | - $this->messageHandle; |
|
| 134 | + $this->parent->getMessageResourceHandle() : $this->messageHandle; |
|
| 137 | 135 | } |
| 138 | 136 | |
| 139 | 137 | /** |
@@ -107,8 +107,7 @@ |
||
| 107 | 107 | $part->setRawHeader( |
| 108 | 108 | HeaderConsts::CONTENT_TRANSFER_ENCODING, |
| 109 | 109 | ($contentType === 'text/plain' || $contentType === 'text/html') ? |
| 110 | - 'quoted-printable' : |
|
| 111 | - 'base64' |
|
| 110 | + 'quoted-printable' : 'base64' |
|
| 112 | 111 | ); |
| 113 | 112 | } |
| 114 | 113 | return $this; |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | public function getUniqueBoundary(string $mimeType) : string |
| 48 | 48 | { |
| 49 | 49 | $type = \ltrim(\strtoupper(\preg_replace('/^(multipart\/(.{3}).*|.*)$/i', '$2-', $mimeType)), '-'); |
| 50 | - return \uniqid('----=MMP-' . $type . '-', true); |
|
| 50 | + return \uniqid('----=MMP-'.$type.'-', true); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $part->setRawHeader( |
| 60 | 60 | HeaderConsts::CONTENT_TYPE, |
| 61 | 61 | "$mimeType;\r\n\tboundary=\"" |
| 62 | - . $this->getUniqueBoundary($mimeType) . '"' |
|
| 62 | + . $this->getUniqueBoundary($mimeType).'"' |
|
| 63 | 63 | ); |
| 64 | 64 | $part->notify(); |
| 65 | 65 | return $this; |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | * under |
| 119 | 119 | * @return bool|IMimePart false if a part is not found |
| 120 | 120 | */ |
| 121 | - public function getContentPartContainerFromAlternative($mimeType, IMimePart $alternativePart) : bool|IMimePart |
|
| 121 | + public function getContentPartContainerFromAlternative($mimeType, IMimePart $alternativePart) : bool | IMimePart |
|
| 122 | 122 | { |
| 123 | 123 | $part = $alternativePart->getPart(0, PartFilter::fromInlineContentType($mimeType)); |
| 124 | 124 | $contPart = null; |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | string $encoding = 'base64' |
| 308 | 308 | ) : IMessagePart { |
| 309 | 309 | if ($filename === null) { |
| 310 | - $filename = 'file' . \uniqid(); |
|
| 310 | + $filename = 'file'.\uniqid(); |
|
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | $safe = \iconv('UTF-8', 'US-ASCII//translit//ignore', $filename); |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | public function __construct(string $message, string $psrLogLevelAsErrorLevel, ErrorBag $object, ?Throwable $exception = null) |
| 59 | 59 | { |
| 60 | 60 | if (!isset($this->levelMap[$psrLogLevelAsErrorLevel])) { |
| 61 | - throw new InvalidArgumentException($psrLogLevelAsErrorLevel . ' is not a known PSR Log Level'); |
|
| 61 | + throw new InvalidArgumentException($psrLogLevelAsErrorLevel.' is not a known PSR Log Level'); |
|
| 62 | 62 | } |
| 63 | 63 | $this->message = $message; |
| 64 | 64 | $this->psrLevel = $psrLogLevelAsErrorLevel; |
@@ -176,7 +176,7 @@ |
||
| 176 | 176 | $class = $this->getClassFor($name); |
| 177 | 177 | $this->logger->debug( |
| 178 | 178 | 'Creating {$class} for header with name "{$name}" and value "{$value}"', |
| 179 | - [ 'class' => $class, 'name' => $name, 'value' => $value ] |
|
| 179 | + ['class' => $class, 'name' => $name, 'value' => $value] |
|
| 180 | 180 | ); |
| 181 | 181 | return $this->newInstanceOf($name, $value, $class); |
| 182 | 182 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | protected function filterAndAssignToParts() : void |
| 78 | 78 | { |
| 79 | - $this->parts = \array_values(\array_filter($this->allParts, function ($p) { |
|
| 79 | + $this->parts = \array_values(\array_filter($this->allParts, function($p) { |
|
| 80 | 80 | return !($p instanceof CommentPart); |
| 81 | 81 | })); |
| 82 | 82 | } |
@@ -117,10 +117,10 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | if ($this->comments === null) { |
| 119 | 119 | $this->comments = \array_values(\array_map( |
| 120 | - function ($p) { return $p->getComment(); }, |
|
| 120 | + function($p) { return $p->getComment(); }, |
|
| 121 | 121 | \array_filter( |
| 122 | 122 | $this->allParts, |
| 123 | - function ($p) { return ($p instanceof CommentPart); } |
|
| 123 | + function($p) { return ($p instanceof CommentPart); } |
|
| 124 | 124 | ) |
| 125 | 125 | )); |
| 126 | 126 | } |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | |
| 153 | 153 | public function getErrorLoggingContextName(): string |
| 154 | 154 | { |
| 155 | - return 'Header::' . $this->getName(); |
|
| 155 | + return 'Header::'.$this->getName(); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | protected function getErrorBagChildren() : array |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $namePart = (count($parts) > 1) ? $parts[0] : ''; |
| 192 | 192 | $valuePart = trim((count($parts) > 1) ? $parts[1] : $parts[0]); |
| 193 | 193 | } |
| 194 | - return [ $namePart, $valuePart ]; |
|
| 194 | + return [$namePart, $valuePart]; |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | /** |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | CommentConsumerService $commentConsumerService, |
| 57 | 57 | string $partName |
| 58 | 58 | ) { |
| 59 | - parent::__construct($partFactory, [ $commentConsumerService ]); |
|
| 59 | + parent::__construct($partFactory, [$commentConsumerService]); |
|
| 60 | 60 | $this->partName = $partName; |
| 61 | 61 | } |
| 62 | 62 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | protected function isStartToken(string $token) : bool |
| 68 | 68 | { |
| 69 | - $pattern = '/^' . \preg_quote($this->partName, '/') . '$/i'; |
|
| 69 | + $pattern = '/^'.\preg_quote($this->partName, '/').'$/i'; |
|
| 70 | 70 | return (\preg_match($pattern, $token) === 1); |
| 71 | 71 | } |
| 72 | 72 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | { |
| 98 | 98 | return [ |
| 99 | 99 | '\s+', |
| 100 | - '(\A\s*|\s+)(?i)' . \preg_quote($this->partName, '/') . '(?-i)(?=\s+)' |
|
| 100 | + '(\A\s*|\s+)(?i)'.\preg_quote($this->partName, '/').'(?-i)(?=\s+)' |
|
| 101 | 101 | ]; |
| 102 | 102 | } |
| 103 | 103 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | foreach ($filtered as $part) { |
| 118 | 118 | if ($part instanceof CommentPart) { |
| 119 | 119 | $ret[] = $part; |
| 120 | - continue; // getValue() is empty anyway, but for clarity... |
|
| 120 | + continue; // getValue() is empty anyway, but for clarity... |
|
| 121 | 121 | } |
| 122 | 122 | $strValue .= $part->getValue(); |
| 123 | 123 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * @param HeaderPart[] $parts |
| 74 | 74 | * @param HeaderPart[] $retParts |
| 75 | 75 | */ |
| 76 | - private function addSpaceToRetParts(array $parts, array &$retParts, int $curIndex, HeaderPart &$spacePart, HeaderPart $lastPart) : static |
|
| 76 | + private function addSpaceToRetParts(array $parts, array &$retParts, int $curIndex, HeaderPart & $spacePart, HeaderPart $lastPart) : static |
|
| 77 | 77 | { |
| 78 | 78 | $nextPart = $parts[$curIndex]; |
| 79 | 79 | if ($this->shouldAddSpace($nextPart, $lastPart)) { |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * @param HeaderPart[] $parts |
| 94 | 94 | * @param HeaderPart[] $retParts |
| 95 | 95 | */ |
| 96 | - private function addSpaces(array $parts, array &$retParts, int $curIndex, ?HeaderPart &$spacePart = null) : static |
|
| 96 | + private function addSpaces(array $parts, array &$retParts, int $curIndex, ?HeaderPart & $spacePart = null) : static |
|
| 97 | 97 | { |
| 98 | 98 | $lastPart = \end($retParts); |
| 99 | 99 | if ($spacePart !== null && $curIndex < \count($parts) && $parts[$curIndex]->getValue() !== '' && $lastPart !== false) { |