@@ -1,4 +1,4 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -define ('TEST_DATA_DIR', __DIR__ . '/tests/_data'); |
|
| 4 | -define ('TEST_OUTPUT_DIR', __DIR__ . '/tests/_output'); |
|
| 3 | +define('TEST_DATA_DIR', __DIR__.'/tests/_data'); |
|
| 4 | +define('TEST_OUTPUT_DIR', __DIR__.'/tests/_output'); |
|
@@ -138,7 +138,7 @@ |
||
| 138 | 138 | { |
| 139 | 139 | if (!$value instanceof IMessagePart) { |
| 140 | 140 | throw new InvalidArgumentException( |
| 141 | - \get_class($value) . ' is not a ZBateson\MailMimeParser\Message\IMessagePart' |
|
| 141 | + \get_class($value).' is not a ZBateson\MailMimeParser\Message\IMessagePart' |
|
| 142 | 142 | ); |
| 143 | 143 | } |
| 144 | 144 | $index = $offset ?? \count($this->children); |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | $dateToken = \preg_replace('# ([0-9]{4})$#', ' +$1', $dateToken); |
| 42 | 42 | // @see https://bugs.php.net/bug.php?id=42486 |
| 43 | 43 | } elseif (\preg_match('#UT$#', $dateToken)) { |
| 44 | - $dateToken = $dateToken . 'C'; |
|
| 44 | + $dateToken = $dateToken.'C'; |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | try { |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | $this->addRawHeaderToPart($offset, $header, $container); |
| 60 | 60 | $header = ''; |
| 61 | 61 | } else { |
| 62 | - $line = "\r\n" . $line; |
|
| 62 | + $line = "\r\n".$line; |
|
| 63 | 63 | } |
| 64 | 64 | $header .= \rtrim($line, "\r\n"); |
| 65 | 65 | } while ($header !== ''); |
@@ -82,11 +82,10 @@ |
||
| 82 | 82 | foreach ($this->parsers as $parser) { |
| 83 | 83 | if ($parser->canParse($partBuilder)) { |
| 84 | 84 | $factory = ($partBuilder->getParent() === null) ? |
| 85 | - $parser->getParserMessageProxyFactory() : |
|
| 86 | - $parser->getParserPartProxyFactory(); |
|
| 85 | + $parser->getParserMessageProxyFactory() : $parser->getParserPartProxyFactory(); |
|
| 87 | 86 | return $factory->newInstance($partBuilder, $parser); |
| 88 | 87 | } |
| 89 | 88 | } |
| 90 | - throw new CompatibleParserNotFoundException('Compatible parser for a part cannot be found with content-type: ' . $partBuilder->getHeaderContainer()->get('Content-Type')); |
|
| 89 | + throw new CompatibleParserNotFoundException('Compatible parser for a part cannot be found with content-type: '.$partBuilder->getHeaderContainer()->get('Content-Type')); |
|
| 91 | 90 | } |
| 92 | 91 | } |
@@ -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,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; |