Completed
Pull Request — 5.x (#28)
by Lars
15:40 queued 04:17
created
lib/classes/Swift/StreamFilters/StringReplacementFilter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
             return false;
48 48
         }
49 49
 
50
-        foreach ((array)$this->_search as $needle) {
50
+        foreach ((array) $this->_search as $needle) {
51 51
             if (
52 52
                 $needle
53 53
                 &&
Please login to merge, or discard this patch.
lib/classes/Swift/Mime/Headers/DateHeader.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
      *
71 71
      * This method returns a UNIX timestamp.
72 72
      *
73
-     * @return mixed
73
+     * @return integer|null
74 74
      */
75 75
     public function getFieldBodyModel()
76 76
     {
Please login to merge, or discard this patch.
lib/classes/Swift/Mime/Headers/AbstractHeader.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     {
107 107
         if ($lang && $this->_lang !== $lang) {
108 108
             $this->clearCachedValue();
109
-            $this->_lang = (string)$lang;
109
+            $this->_lang = (string) $lang;
110 110
         }
111 111
     }
112 112
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         if ($lineLength && $this->_lineLength !== $lineLength) {
166 166
             $this->clearCachedValue();
167 167
 
168
-            $this->_lineLength = (int)$lineLength;
168
+            $this->_lineLength = (int) $lineLength;
169 169
 
170 170
             return true;
171 171
         }
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
         $phraseStr = $string;
230 230
 
231 231
         // If it's not valid ...
232
-        if (!preg_match('/^' . self::PHRASE_PATTERN . '$/D', $phraseStr)) {
232
+        if (!preg_match('/^'.self::PHRASE_PATTERN.'$/D', $phraseStr)) {
233 233
 
234 234
             if (preg_match('/^[\x00-\x08\x0B\x0C\x0E-\x7F]*$/D', $phraseStr)) {
235 235
                 // ... but it is just ascii text, try escaping some characters
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
             }
241 241
 
242 242
             // ... and make it a quoted-string.
243
-            $phraseStr = '"' . $phraseStr . '"';
243
+            $phraseStr = '"'.$phraseStr.'"';
244 244
         }
245 245
 
246 246
         return $phraseStr;
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
     protected function escapeSpecials($token, array $include = array())
258 258
     {
259 259
         foreach (array_merge(array('\\'), $include) as $char) {
260
-            $token = str_replace($char, '\\' . $char, $token);
260
+            $token = str_replace($char, '\\'.$char, $token);
261 261
         }
262 262
 
263 263
         return $token;
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
                         $token = substr($token, 1);
290 290
                 }
291 291
 
292
-                $usedLength = strlen($header->getFieldName() . ': ') + strlen($value);
292
+                $usedLength = strlen($header->getFieldName().': ') + strlen($value);
293 293
                 $value .= $this->getTokenAsEncodedWord($token, $usedLength);
294 294
 
295 295
                 $header->setMaxLineLength(74); // Forcefully override (we need to save two chars for quoting)
@@ -364,10 +364,10 @@  discard block
 block discarded – undo
364 364
         $charsetDecl = $this->_charset;
365 365
 
366 366
         if ($this->_lang) {
367
-            $charsetDecl .= '*' . $this->_lang;
367
+            $charsetDecl .= '*'.$this->_lang;
368 368
         }
369 369
 
370
-        $encodingWrapperLength = strlen('=?' . $charsetDecl . '?' . $this->_encoder->getName() . '??=');
370
+        $encodingWrapperLength = strlen('=?'.$charsetDecl.'?'.$this->_encoder->getName().'??=');
371 371
 
372 372
         if ($firstLineOffset >= 75) {
373 373
             // Does this logic need to be here?
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
         if (Swift::strtolowerWithStaticCache($this->_charset) !== 'iso-2022-jp') {
384 384
             // special encoding for iso-2022-jp using mb_encode_mimeheader
385 385
             foreach ($encodedTextLines as $lineNum => $line) {
386
-                $encodedTextLines[$lineNum] = '=?' . $charsetDecl . '?' . $this->_encoder->getName() . '?' . $line . '?=';
386
+                $encodedTextLines[$lineNum] = '=?'.$charsetDecl.'?'.$this->_encoder->getName().'?'.$line.'?=';
387 387
             }
388 388
         }
389 389
 
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
     {
478 478
         $lineCount = 0;
479 479
         $headerLines = array();
480
-        $headerLines[] = $this->_name . ': ';
480
+        $headerLines[] = $this->_name.': ';
481 481
         $currentLine = &$headerLines[$lineCount++];
482 482
 
483 483
         // Build all tokens back into compliant header
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
                     (
493 493
                         $i > 0
494 494
                         &&
495
-                        strlen($currentLine . $token) > $this->_lineLength
495
+                        strlen($currentLine.$token) > $this->_lineLength
496 496
                     )
497 497
                 )
498 498
             ) {
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
         }
508 508
 
509 509
         // Implode with FWS (RFC 2822, 2.2.3)
510
-        return implode("\r\n", $headerLines) . "\r\n";
510
+        return implode("\r\n", $headerLines)."\r\n";
511 511
     }
512 512
 
513 513
     /**
Please login to merge, or discard this patch.
lib/classes/Swift/Mime/Headers/ParameterizedHeader.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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,19 +182,19 @@  discard block
 block discarded – undo
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
 
195 195
                 // Allow space for the indices, charset and language.
196
-                $maxValueLength = $this->getMaxLineLength() - strlen($name . '*N*="";') - 1;
197
-                $firstLineOffset = strlen($this->getCharset() . "'" . $this->getLanguage() . "'");
196
+                $maxValueLength = $this->getMaxLineLength() - strlen($name.'*N*="";') - 1;
197
+                $firstLineOffset = strlen($this->getCharset()."'".$this->getLanguage()."'");
198 198
             }
199 199
         }
200 200
 
@@ -224,13 +224,13 @@  discard block
 block discarded – undo
224 224
         if (count($valueLines) > 1) {
225 225
             $paramLines = array();
226 226
             foreach ($valueLines as $i => $line) {
227
-                $paramLines[] = $name . '*' . $i . $this->_getEndOfParameterValue($line, true, $i === 0);
227
+                $paramLines[] = $name.'*'.$i.$this->_getEndOfParameterValue($line, true, $i === 0);
228 228
             }
229 229
 
230 230
             return implode(";\r\n ", $paramLines);
231 231
         }
232 232
 
233
-        return $name . $this->_getEndOfParameterValue(
233
+        return $name.$this->_getEndOfParameterValue(
234 234
             $valueLines[0],
235 235
             $encoded,
236 236
             true
@@ -248,18 +248,18 @@  discard block
 block discarded – undo
248 248
      */
249 249
     private function _getEndOfParameterValue($value, $encoded = false, $firstLine = false)
250 250
     {
251
-        if (!preg_match('/^' . self::TOKEN_REGEX . '$/D', $value)) {
252
-            $value = '"' . $value . '"';
251
+        if (!preg_match('/^'.self::TOKEN_REGEX.'$/D', $value)) {
252
+            $value = '"'.$value.'"';
253 253
         }
254 254
 
255 255
         $prepend = '=';
256 256
         if ($encoded) {
257 257
             $prepend = '*=';
258 258
             if ($firstLine) {
259
-                $prepend = '*=' . $this->getCharset() . "'" . $this->getLanguage() . "'";
259
+                $prepend = '*='.$this->getCharset()."'".$this->getLanguage()."'";
260 260
             }
261 261
         }
262 262
 
263
-        return $prepend . $value;
263
+        return $prepend.$value;
264 264
     }
265 265
 }
Please login to merge, or discard this patch.
lib/classes/Swift/Mime/MimePart.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
     /**
214 214
      * Set the nesting level of this entity
215 215
      *
216
-     * @param $level
216
+     * @param integer $level
217 217
      */
218 218
     protected function _setNestingLevel($level)
219 219
     {
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
     /**
224 224
      * Encode charset
225 225
      *
226
-     * @param $string
226
+     * @param string $string
227 227
      *
228 228
      * @return string
229 229
      */
Please login to merge, or discard this patch.
lib/classes/Swift/Transport/EsmtpTransport.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     public function setPort($port)
93 93
     {
94
-        $this->_params['port'] = (int)$port;
94
+        $this->_params['port'] = (int) $port;
95 95
 
96 96
         return $this;
97 97
     }
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
      */
116 116
     public function setTimeout($timeout)
117 117
     {
118
-        $this->_params['timeout'] = (int)$timeout;
119
-        $this->_buffer->setParam('timeout', (int)$timeout);
118
+        $this->_params['timeout'] = (int) $timeout;
119
+        $this->_buffer->setParam('timeout', (int) $timeout);
120 120
 
121 121
         return $this;
122 122
     }
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
      */
257 257
     public function executeCommand($command, $codes = array(), &$failures = null)
258 258
     {
259
-        $failures = (array)$failures;
259
+        $failures = (array) $failures;
260 260
         $stopSignal = false;
261 261
         $response = null;
262 262
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 
288 288
             $inArray = in_array(
289 289
                 Swift::strtolowerWithStaticCache($method),
290
-                array_map(array('Swift', 'strtolowerWithStaticCache'), (array)$handler->exposeMixinMethods()),
290
+                array_map(array('Swift', 'strtolowerWithStaticCache'), (array) $handler->exposeMixinMethods()),
291 291
                 true
292 292
             );
293 293
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
                 }
307 307
             }
308 308
         }
309
-        trigger_error('Call to undefined method ' . $method, E_USER_ERROR);
309
+        trigger_error('Call to undefined method '.$method, E_USER_ERROR);
310 310
     }
311 311
 
312 312
     /** Get the params to initialize the buffer */
@@ -372,10 +372,10 @@  discard block
 block discarded – undo
372 372
 
373 373
         $params = array();
374 374
         foreach ($handlers as $handler) {
375
-            $params = array_merge($params, (array)$handler->getMailParams());
375
+            $params = array_merge($params, (array) $handler->getMailParams());
376 376
         }
377 377
 
378
-        $paramStr = !empty($params) ? ' ' . implode(' ', $params) : '';
378
+        $paramStr = !empty($params) ? ' '.implode(' ', $params) : '';
379 379
         $this->executeCommand(
380 380
             sprintf("MAIL FROM:<%s>%s\r\n", $address, $paramStr), array(250)
381 381
         );
@@ -392,10 +392,10 @@  discard block
 block discarded – undo
392 392
 
393 393
         $params = array();
394 394
         foreach ($handlers as $handler) {
395
-            $params = array_merge($params, (array)$handler->getRcptParams());
395
+            $params = array_merge($params, (array) $handler->getRcptParams());
396 396
         }
397 397
 
398
-        $paramStr = !empty($params) ? ' ' . implode(' ', $params) : '';
398
+        $paramStr = !empty($params) ? ' '.implode(' ', $params) : '';
399 399
         $this->executeCommand(
400 400
             sprintf("RCPT TO:<%s>%s\r\n", $address, $paramStr), array(250, 251, 252)
401 401
         );
Please login to merge, or discard this patch.
lib/classes/Swift/Mime/Attachment.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -167,6 +167,6 @@
 block discarded – undo
167 167
         }
168 168
         $extension = Swift::strtolowerWithStaticCache($extension);
169 169
 
170
-        return (string)$extension;
170
+        return (string) $extension;
171 171
     }
172 172
 }
Please login to merge, or discard this patch.
lib/classes/Swift/ByteStream/FileByteStream.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         if (strpos($path, '?') !== false) {
82 82
             $parameter = parse_url($path, PHP_URL_QUERY);
83 83
 
84
-            $this->_path = str_replace('?' . $parameter, '', $path);
84
+            $this->_path = str_replace('?'.$parameter, '', $path);
85 85
         } else {
86 86
             $this->_path = $path;
87 87
         }
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 
199 199
             if (!$pointer) {
200 200
                 throw new Swift_IoException(
201
-                    'Unable to open file for reading [' . $this->_path . ']'
201
+                    'Unable to open file for reading ['.$this->_path.']'
202 202
                 );
203 203
             }
204 204
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 
222 222
             if (!$pointer) {
223 223
                 throw new Swift_IoException(
224
-                    'Unable to open file for writing [' . $this->_path . ']'
224
+                    'Unable to open file for writing ['.$this->_path.']'
225 225
                 );
226 226
             }
227 227
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 
292 292
         $source = @fopen($this->_path, 'rb');
293 293
         if (!$source) {
294
-            throw new Swift_IoException('Unable to open file for copying [' . $this->_path . ']');
294
+            throw new Swift_IoException('Unable to open file for copying ['.$this->_path.']');
295 295
         }
296 296
 
297 297
         fseek($tmpFile, 0, SEEK_SET);
Please login to merge, or discard this patch.
lib/classes/Swift/FileSpool.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -96,10 +96,10 @@  discard block
 block discarded – undo
96 96
     public function queueMessage(Swift_Mime_Message $message)
97 97
     {
98 98
         $ser = serialize($message);
99
-        $fileName = $this->_path . '/' . $this->getRandomString();
99
+        $fileName = $this->_path.'/'.$this->getRandomString();
100 100
         for ($i = 0; $i < $this->_retryLimit; ++$i) {
101 101
             /* We try an exclusive creation of the file. This is an atomic operation, it avoid locking mechanism */
102
-            $fp = @fopen($fileName . '.message', 'x');
102
+            $fp = @fopen($fileName.'.message', 'x');
103 103
             if (false !== $fp) {
104 104
                 if (false === fwrite($fp, $ser)) {
105 105
                     return false;
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
             }
157 157
         }
158 158
 
159
-        $failedRecipients = (array)$failedRecipients;
159
+        $failedRecipients = (array) $failedRecipients;
160 160
         $count = 0;
161 161
         $time = time();
162 162
         foreach ($directoryIterator as $file) {
@@ -167,12 +167,12 @@  discard block
 block discarded – undo
167 167
             }
168 168
 
169 169
             /* We try a rename, it's an atomic operation, and avoid locking the file */
170
-            if (rename($file, $file . '.sending')) {
171
-                $message = unserialize(file_get_contents($file . '.sending'));
170
+            if (rename($file, $file.'.sending')) {
171
+                $message = unserialize(file_get_contents($file.'.sending'));
172 172
 
173 173
                 $count += $transport->send($message, $failedRecipients);
174 174
 
175
-                unlink($file . '.sending');
175
+                unlink($file.'.sending');
176 176
             } else {
177 177
                 /* This message has just been catched by another process */
178 178
                 continue;
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
         $ret = '';
210 210
         $strlen = strlen($base) - 1;
211 211
         for ($i = 0; $i < $count; ++$i) {
212
-            $ret .= $base[(int)mt_rand(0, $strlen)];
212
+            $ret .= $base[(int) mt_rand(0, $strlen)];
213 213
         }
214 214
 
215 215
         return $ret;
Please login to merge, or discard this patch.