diff --git a/src/Ddeboer/Imap/Connection.php b/src/Ddeboer/Imap/Connection.php index 068cf4d8..24b9cf95 100644 --- a/src/Ddeboer/Imap/Connection.php +++ b/src/Ddeboer/Imap/Connection.php @@ -140,4 +140,4 @@ protected function getMailboxNames() return $this->mailboxNames; } -} \ No newline at end of file +} diff --git a/src/Ddeboer/Imap/Exception/AuthenticationFailedException.php b/src/Ddeboer/Imap/Exception/AuthenticationFailedException.php index 1e520a2f..759fbb08 100644 --- a/src/Ddeboer/Imap/Exception/AuthenticationFailedException.php +++ b/src/Ddeboer/Imap/Exception/AuthenticationFailedException.php @@ -8,4 +8,4 @@ public function __construct($user) { parent::__construct('Authentication failed for user ' . $user); } -} \ No newline at end of file +} diff --git a/src/Ddeboer/Imap/Exception/Exception.php b/src/Ddeboer/Imap/Exception/Exception.php index 8648897b..f1de8148 100644 --- a/src/Ddeboer/Imap/Exception/Exception.php +++ b/src/Ddeboer/Imap/Exception/Exception.php @@ -21,4 +21,4 @@ public function getErrors() { return $this->errors; } -} \ No newline at end of file +} diff --git a/src/Ddeboer/Imap/Exception/MailboxDoesNotExistException.php b/src/Ddeboer/Imap/Exception/MailboxDoesNotExistException.php index ad0b36b3..8f11d19b 100644 --- a/src/Ddeboer/Imap/Exception/MailboxDoesNotExistException.php +++ b/src/Ddeboer/Imap/Exception/MailboxDoesNotExistException.php @@ -8,4 +8,4 @@ public function __construct($mailbox) { parent::__construct('Mailbox ' . $mailbox. ' does not exist'); } -} \ No newline at end of file +} diff --git a/src/Ddeboer/Imap/Exception/MessageDeleteException.php b/src/Ddeboer/Imap/Exception/MessageDeleteException.php index 8458f358..a6a0b88a 100644 --- a/src/Ddeboer/Imap/Exception/MessageDeleteException.php +++ b/src/Ddeboer/Imap/Exception/MessageDeleteException.php @@ -2,10 +2,10 @@ namespace Ddeboer\Imap\Exception; -class MessageCannotBeDeletedException extends Exception +class MessageDeleteException extends Exception { public function __construct($messageNumber) { parent::__construct(sprintf('Message %s cannot be deleted', $messageNumber)); } -} \ No newline at end of file +} diff --git a/src/Ddeboer/Imap/Exception/MessageMoveException.php b/src/Ddeboer/Imap/Exception/MessageMoveException.php index e88ee5dd..4b7d5c0f 100644 --- a/src/Ddeboer/Imap/Exception/MessageMoveException.php +++ b/src/Ddeboer/Imap/Exception/MessageMoveException.php @@ -14,4 +14,4 @@ public function __construct($messageNumber, $mailbox) ) ); } -} \ No newline at end of file +} diff --git a/src/Ddeboer/Imap/Mailbox.php b/src/Ddeboer/Imap/Mailbox.php index 83d06d0a..72d6ad9d 100644 --- a/src/Ddeboer/Imap/Mailbox.php +++ b/src/Ddeboer/Imap/Mailbox.php @@ -2,8 +2,6 @@ namespace Ddeboer\Imap; -use Ddeboer\Imap\Exception\Exception; - /** * An IMAP mailbox (commonly referred to as a ‘folder’) * @@ -53,7 +51,7 @@ public function count() * * @param SearchExpression $search Search expression (optional) * - * @return MessageIterator + * @return MessageIterator|Message[] */ public function getMessages(SearchExpression $search = null) { @@ -142,4 +140,3 @@ protected function init() } } } - diff --git a/src/Ddeboer/Imap/Message.php b/src/Ddeboer/Imap/Message.php index cc543fef..65adb713 100644 --- a/src/Ddeboer/Imap/Message.php +++ b/src/Ddeboer/Imap/Message.php @@ -3,7 +3,7 @@ namespace Ddeboer\Imap; use Ddeboer\Imap\Message\EmailAddress; -use Ddeboer\Imap\Exception\MessageCannotBeDeletedException; +use Ddeboer\Imap\Exception\MessageDeleteException; use Ddeboer\Imap\Exception\MessageMoveException; /** @@ -223,8 +223,8 @@ public function getAttachments() if ($part instanceof Message\Attachment) { $this->attachments[] = $part; } - if($part->hasChildren()) { - foreach($part->getParts() AS $child_part) { + if ($part->hasChildren()) { + foreach ($part->getParts() AS $child_part) { if ($child_part instanceof Message\Attachment) { $this->attachments[] = $child_part; } @@ -255,7 +255,7 @@ public function delete() $this->headers = null; if (!\imap_delete($this->stream, $this->messageNumber)) { - throw new MessageCannotBeDeletedException($this->messageNumber); + throw new MessageDeleteException($this->messageNumber); } } @@ -299,4 +299,4 @@ protected function loadStructure() $structure = \imap_fetchstructure($this->stream, $this->messageNumber, \FT_UID); $this->parseStructure($structure); } -} \ No newline at end of file +} diff --git a/src/Ddeboer/Imap/Message/Attachment.php b/src/Ddeboer/Imap/Message/Attachment.php index 4f18a5ea..cc77f812 100644 --- a/src/Ddeboer/Imap/Message/Attachment.php +++ b/src/Ddeboer/Imap/Message/Attachment.php @@ -39,4 +39,4 @@ public function getSize() { return $this->parameters->get('size'); } -} \ No newline at end of file +} diff --git a/src/Ddeboer/Imap/Message/Part.php b/src/Ddeboer/Imap/Message/Part.php index 85aae009..c65929f7 100644 --- a/src/Ddeboer/Imap/Message/Part.php +++ b/src/Ddeboer/Imap/Message/Part.php @@ -80,7 +80,7 @@ class Part implements \RecursiveIterator * Constructor * * @param \stdClass $part The part - * @param string $number The part number + * @param string $number The part number */ public function __construct($stream, $messageNumber, $partNumber = null, $structure = null) { @@ -315,4 +315,4 @@ protected function doGetContent($keepUnseen = false) \FT_UID | ($keepUnseen ? \FT_PEEK : null) ); } -} \ No newline at end of file +} diff --git a/src/Ddeboer/Imap/MessageIterator.php b/src/Ddeboer/Imap/MessageIterator.php index d779d665..90b23e80 100644 --- a/src/Ddeboer/Imap/MessageIterator.php +++ b/src/Ddeboer/Imap/MessageIterator.php @@ -15,7 +15,7 @@ class MessageIterator extends \ArrayIterator public function __construct($stream, array $messageNumbers) { $this->stream = $stream; - + parent::__construct($messageNumbers); } @@ -29,4 +29,3 @@ public function current() return new Message($this->stream, parent::current()); } } - diff --git a/src/Ddeboer/Imap/Search/Date/After.php b/src/Ddeboer/Imap/Search/Date/After.php index 12ff5552..1205a0ff 100644 --- a/src/Ddeboer/Imap/Search/Date/After.php +++ b/src/Ddeboer/Imap/Search/Date/After.php @@ -3,9 +3,6 @@ namespace Ddeboer\Imap\Search\Date; use Ddeboer\Imap\Search\Date; -use Ddeboer\Imap\Search\Condition; - -use DateTime; /** * Represents a date after condition. Messages must have a date after the diff --git a/src/Ddeboer/Imap/Search/Date/Before.php b/src/Ddeboer/Imap/Search/Date/Before.php index 6686533e..93e164b4 100644 --- a/src/Ddeboer/Imap/Search/Date/Before.php +++ b/src/Ddeboer/Imap/Search/Date/Before.php @@ -3,9 +3,6 @@ namespace Ddeboer\Imap\Search\Date; use Ddeboer\Imap\Search\Date; -use Ddeboer\Imap\Search\Condition; - -use DateTime; /** * Represents a date before condition. Messages must have a date before the diff --git a/src/Ddeboer/Imap/Search/Date/On.php b/src/Ddeboer/Imap/Search/Date/On.php index b5989104..02f156ab 100644 --- a/src/Ddeboer/Imap/Search/Date/On.php +++ b/src/Ddeboer/Imap/Search/Date/On.php @@ -3,9 +3,6 @@ namespace Ddeboer\Imap\Search\Date; use Ddeboer\Imap\Search\Date; -use Ddeboer\Imap\Search\Condition; - -use DateTime; /** * Represents a date on condition. Messages must have a date matching the diff --git a/src/Ddeboer/Imap/SearchExpression.php b/src/Ddeboer/Imap/SearchExpression.php index b07e5fea..17a09204 100644 --- a/src/Ddeboer/Imap/SearchExpression.php +++ b/src/Ddeboer/Imap/SearchExpression.php @@ -19,7 +19,7 @@ class SearchExpression /** * Adds a new condition to the expression. * - * @param Condition $condition The condition to be added. + * @param Condition $condition The condition to be added. * @return SearchExpression */ public function addCondition(Condition $condition) diff --git a/tests/Ddeboer/Imap/Tests/AbstractTest.php b/tests/Ddeboer/Imap/Tests/AbstractTest.php index 4e9e777f..8b76d0f9 100644 --- a/tests/Ddeboer/Imap/Tests/AbstractTest.php +++ b/tests/Ddeboer/Imap/Tests/AbstractTest.php @@ -91,4 +91,4 @@ protected function createTestMessage( $mailbox->addMessage($message); } -} \ No newline at end of file +} diff --git a/tests/Ddeboer/Imap/Tests/ConnectionTest.php b/tests/Ddeboer/Imap/Tests/ConnectionTest.php index fb7d2efa..297763a9 100644 --- a/tests/Ddeboer/Imap/Tests/ConnectionTest.php +++ b/tests/Ddeboer/Imap/Tests/ConnectionTest.php @@ -48,4 +48,4 @@ public function testGetInvalidMailbox() { static::getConnection()->getMailbox('does-not-exist'); } -} \ No newline at end of file +} diff --git a/tests/Ddeboer/Imap/Tests/MailboxTest.php b/tests/Ddeboer/Imap/Tests/MailboxTest.php index 3a151362..3753d715 100644 --- a/tests/Ddeboer/Imap/Tests/MailboxTest.php +++ b/tests/Ddeboer/Imap/Tests/MailboxTest.php @@ -3,7 +3,6 @@ namespace Ddeboer\Imap\Tests; use Ddeboer\Imap\Mailbox; -use Ddeboer\Imap\Exception\MailboxDoesNotExistException; class MailboxTest extends AbstractTest { diff --git a/tests/Ddeboer/Imap/Tests/MessageTest.php b/tests/Ddeboer/Imap/Tests/MessageTest.php index 751cf604..eb07997d 100644 --- a/tests/Ddeboer/Imap/Tests/MessageTest.php +++ b/tests/Ddeboer/Imap/Tests/MessageTest.php @@ -46,4 +46,4 @@ public function testSubjectEncoding() $this->assertEquals('lietuviškos raidės', $message->getSubject()); $this->assertEquals('lietuviškos raidės', $message->getBodyText()); } -} \ No newline at end of file +} diff --git a/tests/Ddeboer/Imap/Tests/ServerTest.php b/tests/Ddeboer/Imap/Tests/ServerTest.php index cc5ef847..4f2346cd 100644 --- a/tests/Ddeboer/Imap/Tests/ServerTest.php +++ b/tests/Ddeboer/Imap/Tests/ServerTest.php @@ -14,4 +14,4 @@ public function testFailedAuthenticate() $server = new Server('imap.gmail.com'); $server->authenticate('fake_username', 'fake_password'); } -} \ No newline at end of file +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 57b63450..e639d7b3 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -9,4 +9,4 @@ "); } -$loader = require $vendorDir . '/autoload.php'; \ No newline at end of file +$loader = require $vendorDir . '/autoload.php';