@@ -30,6 +30,6 @@ |
||
30 | 30 | */ |
31 | 31 | public function isValidSimpleWrapper($email) |
32 | 32 | { |
33 | - return (boolean)preg_match('/^(.*<?)(.*)@(.*)(>?)$/', $email); |
|
33 | + return (boolean) preg_match('/^(.*<?)(.*)@(.*)(>?)$/', $email); |
|
34 | 34 | } |
35 | 35 | } |
@@ -77,9 +77,9 @@ |
||
77 | 77 | } |
78 | 78 | |
79 | 79 | $count = ( |
80 | - count((array)$message->getTo()) |
|
81 | - + count((array)$message->getCc()) |
|
82 | - + count((array)$message->getBcc()) |
|
80 | + count((array) $message->getTo()) |
|
81 | + + count((array) $message->getCc()) |
|
82 | + + count((array) $message->getBcc()) |
|
83 | 83 | ); |
84 | 84 | |
85 | 85 | return $count; |
@@ -111,7 +111,7 @@ |
||
111 | 111 | if ($i !== null) { |
112 | 112 | $tree[-1] = min(count($replace) - 1, $i); |
113 | 113 | $tree[-2] = $last_size; |
114 | - $this->_treeMaxLen = (int)$size; |
|
114 | + $this->_treeMaxLen = (int) $size; |
|
115 | 115 | } |
116 | 116 | foreach ($replace as $rep) { |
117 | 117 | if (!is_array($rep)) { |
@@ -8,17 +8,17 @@ |
||
8 | 8 | * file that was distributed with this source code. |
9 | 9 | */ |
10 | 10 | |
11 | -require __DIR__ . '/classes/Swift.php'; |
|
11 | +require __DIR__.'/classes/Swift.php'; |
|
12 | 12 | |
13 | 13 | Swift::registerAutoload( |
14 | - function () { |
|
14 | + function() { |
|
15 | 15 | // Load in dependency maps |
16 | - require __DIR__ . '/dependency_maps/cache_deps.php'; |
|
17 | - require __DIR__ . '/dependency_maps/mime_deps.php'; |
|
18 | - require __DIR__ . '/dependency_maps/message_deps.php'; |
|
19 | - require __DIR__ . '/dependency_maps/transport_deps.php'; |
|
16 | + require __DIR__.'/dependency_maps/cache_deps.php'; |
|
17 | + require __DIR__.'/dependency_maps/mime_deps.php'; |
|
18 | + require __DIR__.'/dependency_maps/message_deps.php'; |
|
19 | + require __DIR__.'/dependency_maps/transport_deps.php'; |
|
20 | 20 | |
21 | 21 | // Load in global library preferences |
22 | - require __DIR__ . '/preferences.php'; |
|
22 | + require __DIR__.'/preferences.php'; |
|
23 | 23 | } |
24 | 24 | ); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require __DIR__ . '/../mime_types.php'; |
|
3 | +require __DIR__.'/../mime_types.php'; |
|
4 | 4 | |
5 | 5 | Swift_DependencyContainer::getInstance() |
6 | 6 | ->register('properties.charset') |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | foreach ($this->_params as $name => $value) { |
133 | 133 | if (null !== $value) { |
134 | 134 | // Add the parameter |
135 | - $body .= '; ' . $this->_createParameter($name, $value); |
|
135 | + $body .= '; '.$this->_createParameter($name, $value); |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $tokens[count($tokens) - 1] .= ';'; |
161 | 161 | $tokens = array_merge( |
162 | 162 | $tokens, |
163 | - $this->generateTokenLines(' ' . $this->_createParameter($name, $value)) |
|
163 | + $this->generateTokenLines(' '.$this->_createParameter($name, $value)) |
|
164 | 164 | ); |
165 | 165 | } |
166 | 166 | } |
@@ -182,18 +182,18 @@ discard block |
||
182 | 182 | |
183 | 183 | $encoded = false; |
184 | 184 | // Allow room for parameter name, indices, "=" and DQUOTEs |
185 | - $maxValueLength = $this->getMaxLineLength() - strlen($name . '=*N"";') - 1; |
|
185 | + $maxValueLength = $this->getMaxLineLength() - strlen($name.'=*N"";') - 1; |
|
186 | 186 | $firstLineOffset = 0; |
187 | 187 | |
188 | 188 | // If it's not already a valid parameter value... |
189 | - if (!preg_match('/^' . self::TOKEN_REGEX . '$/D', $value)) { |
|
189 | + if (!preg_match('/^'.self::TOKEN_REGEX.'$/D', $value)) { |
|
190 | 190 | // TODO: text, or something else?? |
191 | 191 | // ... and it's not ascii |
192 | 192 | if (!preg_match('/^[\x00-\x08\x0B\x0C\x0E-\x7F]*$/D', $value)) { |
193 | 193 | $encoded = true; |
194 | 194 | // Allow space for the indices, charset and language |
195 | - $maxValueLength = $this->getMaxLineLength() - strlen($name . '*N*="";') - 1; |
|
196 | - $firstLineOffset = strlen($this->getCharset() . "'" . $this->getLanguage() . "'"); |
|
195 | + $maxValueLength = $this->getMaxLineLength() - strlen($name.'*N*="";') - 1; |
|
196 | + $firstLineOffset = strlen($this->getCharset()."'".$this->getLanguage()."'"); |
|
197 | 197 | } |
198 | 198 | } |
199 | 199 | |
@@ -219,12 +219,12 @@ discard block |
||
219 | 219 | if (count($valueLines) > 1) { |
220 | 220 | $paramLines = array(); |
221 | 221 | foreach ($valueLines as $i => $line) { |
222 | - $paramLines[] = $name . '*' . $i . $this->_getEndOfParameterValue($line, true, $i === 0); |
|
222 | + $paramLines[] = $name.'*'.$i.$this->_getEndOfParameterValue($line, true, $i === 0); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | return implode(";\r\n ", $paramLines); |
226 | 226 | } else { |
227 | - return $name . $this->_getEndOfParameterValue( |
|
227 | + return $name.$this->_getEndOfParameterValue( |
|
228 | 228 | $valueLines[0], |
229 | 229 | $encoded, |
230 | 230 | true |
@@ -243,18 +243,18 @@ discard block |
||
243 | 243 | */ |
244 | 244 | private function _getEndOfParameterValue($value, $encoded = false, $firstLine = false) |
245 | 245 | { |
246 | - if (!preg_match('/^' . self::TOKEN_REGEX . '$/D', $value)) { |
|
247 | - $value = '"' . $value . '"'; |
|
246 | + if (!preg_match('/^'.self::TOKEN_REGEX.'$/D', $value)) { |
|
247 | + $value = '"'.$value.'"'; |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | $prepend = '='; |
251 | 251 | if ($encoded) { |
252 | 252 | $prepend = '*='; |
253 | 253 | if ($firstLine) { |
254 | - $prepend = '*=' . $this->getCharset() . "'" . $this->getLanguage() . "'"; |
|
254 | + $prepend = '*='.$this->getCharset()."'".$this->getLanguage()."'"; |
|
255 | 255 | } |
256 | 256 | } |
257 | 257 | |
258 | - return $prepend . $value; |
|
258 | + return $prepend.$value; |
|
259 | 259 | } |
260 | 260 | } |
@@ -113,7 +113,7 @@ |
||
113 | 113 | */ |
114 | 114 | public function toString() |
115 | 115 | { |
116 | - return $this->_fieldName . ': ' . $this->_value; |
|
116 | + return $this->_fieldName.': '.$this->_value; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $angleAddrs = array(); |
157 | 157 | |
158 | 158 | foreach ($this->_ids as $id) { |
159 | - $angleAddrs[] = '<' . $id . '>'; |
|
159 | + $angleAddrs[] = '<'.$id.'>'; |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | $this->setCachedValue(implode(' ', $angleAddrs)); |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | { |
177 | 177 | if ($this->_emailValidator->isValidSimpleWrapper($id) === false) { |
178 | 178 | throw new Swift_RfcComplianceException( |
179 | - 'Invalid ID given <' . $id . '>' |
|
179 | + 'Invalid ID given <'.$id.'>' |
|
180 | 180 | ); |
181 | 181 | } |
182 | 182 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function setNameAddresses($mailboxes) |
111 | 111 | { |
112 | - $this->_mailboxes = $this->normalizeMailboxes((array)$mailboxes); |
|
112 | + $this->_mailboxes = $this->normalizeMailboxes((array) $mailboxes); |
|
113 | 113 | $this->setCachedValue(null); //Clear any cached value |
114 | 114 | } |
115 | 115 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | */ |
195 | 195 | public function setAddresses($addresses) |
196 | 196 | { |
197 | - $this->setNameAddresses(array_values((array)$addresses)); |
|
197 | + $this->setNameAddresses(array_values((array) $addresses)); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | /** |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | public function removeAddresses($addresses) |
218 | 218 | { |
219 | 219 | $this->setCachedValue(null); |
220 | - foreach ((array)$addresses as $address) { |
|
220 | + foreach ((array) $addresses as $address) { |
|
221 | 221 | unset($this->_mailboxes[$address]); |
222 | 222 | } |
223 | 223 | } |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | $mailboxStr = $email; |
334 | 334 | if ($name) { |
335 | 335 | $nameStr = $this->createDisplayNameString($name, empty($strings)); |
336 | - $mailboxStr = $nameStr . ' <' . $mailboxStr . '>'; |
|
336 | + $mailboxStr = $nameStr.' <'.$mailboxStr.'>'; |
|
337 | 337 | } |
338 | 338 | $strings[] = $mailboxStr; |
339 | 339 | } |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | private function _assertValidAddress($address) |
352 | 352 | { |
353 | 353 | if ($this->_emailValidator->isValidWrapper($address) === false) { |
354 | - throw new Swift_RfcComplianceException('Address in mailbox given [' . $address . '] does not comply with RFC 2822, 3.6.2.'); |
|
354 | + throw new Swift_RfcComplianceException('Address in mailbox given ['.$address.'] does not comply with RFC 2822, 3.6.2.'); |
|
355 | 355 | } |
356 | 356 | } |
357 | 357 | } |