Skip to content

Commit 0c3f751

Browse files
committed
Ran PHP-CS-Fixer again.
1 parent b6fa0f4 commit 0c3f751

File tree

3 files changed

+38
-39
lines changed

3 files changed

+38
-39
lines changed

src/Fetch/Attachment.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ public function __construct(Message $message, $structure, $partIdentifier = null
109109
}
110110

111111
/**
112-
* This function returns the data of the attachment. Combined with
112+
* This function returns the data of the attachment. Combined with
113113
* getMimeType() it can be used to directly output data to a browser.
114-
*
115-
* If the attachment file is message/rfc822, skip processing/decoding the
116-
* contents in order to avoid mangling the file. Otherwise, decode as
114+
*
115+
* If the attachment file is message/rfc822, skip processing/decoding the
116+
* contents in order to avoid mangling the file. Otherwise, decode as
117117
* normal to ensure other files are handled correctly.
118118
*
119119
* @return string

src/Fetch/Message.php

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -445,27 +445,27 @@ public function getImapBox()
445445

446446
/**
447447
* Adds an attachment
448-
*
449-
* If a filename is not provided and the attachment is a message/rfc822
450-
* email, parse the Subject line and use it as the filename. If the Subject
451-
* line is blank or illegible, use a default filename (like Gmail and some
448+
*
449+
* If a filename is not provided and the attachment is a message/rfc822
450+
* email, parse the Subject line and use it as the filename. If the Subject
451+
* line is blank or illegible, use a default filename (like Gmail and some
452452
* desktop clients do)
453453
*
454-
* @param array $parameters
455-
* @param \stdClass $structure
456-
* @param string $partIdentifier
457-
* @return boolean Successful attachment of file
454+
* @param array $parameters
455+
* @param \stdClass $structure
456+
* @param string $partIdentifier
457+
* @return boolean Successful attachment of file
458458
*/
459459
protected function addAttachment($parameters, $structure, $partIdentifier)
460460
{
461461
if (!(isset($parameters["name"]) || isset($parameters["filename"])) && $structure->type == self::TYPE_MESSAGE) {
462462
$body = isset($partIdentifier) ?
463463
imap_fetchbody($this->imapStream, $this->uid, $partIdentifier, FT_UID)
464464
: imap_body($this->imapStream, $this->uid, FT_UID);
465-
465+
466466
$headers = iconv_mime_decode_headers($body, 0, self::$charset);
467467
$filename = !empty($headers["Subject"]) ? $this->makeFilenameSafe($headers["Subject"]) : "email";
468-
468+
469469
$dpar = new \stdClass();
470470
$dpar->attribute = "filename";
471471
$dpar->value = str_replace(array("\r", "\n"), '', $filename) . ".eml";
@@ -483,26 +483,26 @@ protected function addAttachment($parameters, $structure, $partIdentifier)
483483
}
484484

485485
/**
486-
* This function extracts the body of an email part, strips harmful
487-
* Outlook-specific strings from it, processes any encoded one-liners,
488-
* decodes it, converts it to the charset of the parent message, and
486+
* This function extracts the body of an email part, strips harmful
487+
* Outlook-specific strings from it, processes any encoded one-liners,
488+
* decodes it, converts it to the charset of the parent message, and
489489
* returns the result.
490490
*
491-
* @param array $parameters
492-
* @param \stdClass $structure
493-
* @param string $partIdentifier
491+
* @param array $parameters
492+
* @param \stdClass $structure
493+
* @param string $partIdentifier
494494
* @return string
495495
*/
496496
protected function processBody($structure, $partIdentifier)
497497
{
498498
$rawBody = isset($partIdentifier) ?
499499
imap_fetchbody($this->imapStream, $this->uid, $partIdentifier, FT_UID)
500500
: imap_body($this->imapStream, $this->uid, FT_UID);
501-
501+
502502
$bodyNoOutlook = $this->stripOutlookSpecificStrings($rawBody);
503-
503+
504504
$decodedBody = self::decode($bodyNoOutlook, $structure->encoding);
505-
505+
506506
$inCharset = $inCharset = mb_detect_encoding($decodedBody, array(
507507
"US-ASCII",
508508
"ISO-8859-1",
@@ -520,41 +520,41 @@ protected function processBody($structure, $partIdentifier)
520520
"UCS2",
521521
"UCS4")
522522
);
523-
523+
524524
if ($inCharset && $inCharset !== self::$charset) {
525525
$decodedBody = iconv($inCharset, self::$charset, $decodedBody);
526526
}
527527

528528
return $decodedBody;
529529
}
530-
530+
531531
/**
532-
* Removes "Thread-Index:" line from the message body which is placed there
532+
* Removes "Thread-Index:" line from the message body which is placed there
533533
* by Outlook and messes up the other processing steps.
534-
*
535-
* @param string $messageBody
534+
*
535+
* @param string $messageBody
536536
* @return string
537537
*/
538538
protected function stripOutlookSpecificStrings($bodyBefore)
539539
{
540540
$bodyAfter = preg_replace('/Thread-Index:.*$/m', "", $bodyBefore);
541-
541+
542542
return $bodyAfter;
543543
}
544-
544+
545545
/**
546-
* This function takes in a string to be used as a filename and replaces
547-
* any dangerous characters with underscores to ensure compatibility with
546+
* This function takes in a string to be used as a filename and replaces
547+
* any dangerous characters with underscores to ensure compatibility with
548548
* various file systems
549-
*
550-
* @param string $oldName
549+
*
550+
* @param string $oldName
551551
* @return string
552552
*/
553553
protected function makeFilenameSafe($oldName)
554554
{
555555
return preg_replace('/[<>"{}|\\\^\[\]`;\/\?:@&=$,]/',"_", $oldName);
556556
}
557-
557+
558558
/**
559559
* This function takes in a structure and identifier and processes that part of the message. If that portion of the
560560
* message has its own subparts, those are recursively processed using this function.
@@ -565,7 +565,7 @@ protected function makeFilenameSafe($oldName)
565565
protected function processStructure($structure, $partIdentifier = null)
566566
{
567567
$attached = false;
568-
568+
569569
// TODO: Get HTML attachments working, too!
570570
if (isset($structure->disposition) && $structure->disposition == "attachment") {
571571
$parameters = self::getParametersFromStructure($structure);
@@ -632,7 +632,7 @@ public static function decode($data, $encoding)
632632
return $data;
633633
}
634634
}
635-
635+
636636
/**
637637
* This function returns the body type that an imap integer maps to.
638638
*

src/Fetch/Server.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,7 @@ public function setAuthentication($username, $password)
155155
*/
156156
public function setMailBox($mailbox = '')
157157
{
158-
if(!$this->hasMailBox($mailbox)) {
159-
158+
if (!$this->hasMailBox($mailbox)) {
160159
return false;
161160
}
162161

0 commit comments

Comments
 (0)