@@ -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); |
@@ -154,7 +154,7 @@ |
||
154 | 154 | return \array_reduce( |
155 | 155 | $parts, |
156 | 156 | function($carry, $item) { |
157 | - return $carry . $item; |
|
157 | + return $carry.$item; |
|
158 | 158 | }, |
159 | 159 | '' |
160 | 160 | ); |
@@ -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 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | protected function isStartToken(string $token) : bool |
76 | 76 | { |
77 | - $pattern = '/^' . \preg_quote($this->partName, '/') . '$/i'; |
|
77 | + $pattern = '/^'.\preg_quote($this->partName, '/').'$/i'; |
|
78 | 78 | return (\preg_match($pattern, $token) === 1); |
79 | 79 | } |
80 | 80 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | { |
106 | 106 | return [ |
107 | 107 | '\s+', |
108 | - '(\A\s*|\s+)(?i)' . \preg_quote($this->partName, '/') . '(?-i)(?=\s+)' |
|
108 | + '(\A\s*|\s+)(?i)'.\preg_quote($this->partName, '/').'(?-i)(?=\s+)' |
|
109 | 109 | ]; |
110 | 110 | } |
111 | 111 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | foreach ($filtered as $part) { |
126 | 126 | if ($part instanceof CommentPart) { |
127 | 127 | $ret[] = $part; |
128 | - continue; // getValue() is empty anyway, but for clarity... |
|
128 | + continue; // getValue() is empty anyway, but for clarity... |
|
129 | 129 | } |
130 | 130 | $strValue .= $part->getValue(); |
131 | 131 | } |
@@ -105,7 +105,7 @@ |
||
105 | 105 | |
106 | 106 | $strValue = $ehloName; |
107 | 107 | if ($commentPart !== null && $this->matchHostPart($commentPart->getComment(), $hostname, $address)) { |
108 | - $strValue .= ' (' . $commentPart->getComment() . ')'; |
|
108 | + $strValue .= ' ('.$commentPart->getComment().')'; |
|
109 | 109 | $commentPart = null; |
110 | 110 | } |
111 | 111 |
@@ -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 | } |