Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeboer committed Aug 10, 2014
1 parent 7dae686 commit 9bb97e6
Show file tree
Hide file tree
Showing 21 changed files with 23 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/Ddeboer/Imap/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,4 @@ protected function getMailboxNames()

return $this->mailboxNames;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ public function __construct($user)
{
parent::__construct('Authentication failed for user ' . $user);
}
}
}
2 changes: 1 addition & 1 deletion src/Ddeboer/Imap/Exception/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ public function getErrors()
{
return $this->errors;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ public function __construct($mailbox)
{
parent::__construct('Mailbox ' . $mailbox. ' does not exist');
}
}
}
4 changes: 2 additions & 2 deletions src/Ddeboer/Imap/Exception/MessageDeleteException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}
2 changes: 1 addition & 1 deletion src/Ddeboer/Imap/Exception/MessageMoveException.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ public function __construct($messageNumber, $mailbox)
)
);
}
}
}
5 changes: 1 addition & 4 deletions src/Ddeboer/Imap/Mailbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Ddeboer\Imap;

use Ddeboer\Imap\Exception\Exception;

/**
* An IMAP mailbox (commonly referred to as a ‘folder’)
*
Expand Down Expand Up @@ -53,7 +51,7 @@ public function count()
*
* @param SearchExpression $search Search expression (optional)
*
* @return MessageIterator
* @return MessageIterator|Message[]
*/
public function getMessages(SearchExpression $search = null)
{
Expand Down Expand Up @@ -142,4 +140,3 @@ protected function init()
}
}
}

10 changes: 5 additions & 5 deletions src/Ddeboer/Imap/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -299,4 +299,4 @@ protected function loadStructure()
$structure = \imap_fetchstructure($this->stream, $this->messageNumber, \FT_UID);
$this->parseStructure($structure);
}
}
}
2 changes: 1 addition & 1 deletion src/Ddeboer/Imap/Message/Attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ public function getSize()
{
return $this->parameters->get('size');
}
}
}
4 changes: 2 additions & 2 deletions src/Ddeboer/Imap/Message/Part.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -315,4 +315,4 @@ protected function doGetContent($keepUnseen = false)
\FT_UID | ($keepUnseen ? \FT_PEEK : null)
);
}
}
}
3 changes: 1 addition & 2 deletions src/Ddeboer/Imap/MessageIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MessageIterator extends \ArrayIterator
public function __construct($stream, array $messageNumbers)
{
$this->stream = $stream;

parent::__construct($messageNumbers);
}

Expand All @@ -29,4 +29,3 @@ public function current()
return new Message($this->stream, parent::current());
}
}

3 changes: 0 additions & 3 deletions src/Ddeboer/Imap/Search/Date/After.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/Ddeboer/Imap/Search/Date/Before.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/Ddeboer/Imap/Search/Date/On.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Ddeboer/Imap/SearchExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/Ddeboer/Imap/Tests/AbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ protected function createTestMessage(

$mailbox->addMessage($message);
}
}
}
2 changes: 1 addition & 1 deletion tests/Ddeboer/Imap/Tests/ConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ public function testGetInvalidMailbox()
{
static::getConnection()->getMailbox('does-not-exist');
}
}
}
1 change: 0 additions & 1 deletion tests/Ddeboer/Imap/Tests/MailboxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Ddeboer\Imap\Tests;

use Ddeboer\Imap\Mailbox;
use Ddeboer\Imap\Exception\MailboxDoesNotExistException;

class MailboxTest extends AbstractTest
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Ddeboer/Imap/Tests/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ public function testSubjectEncoding()
$this->assertEquals('lietuviškos raidės', $message->getSubject());
$this->assertEquals('lietuviškos raidės', $message->getBodyText());
}
}
}
2 changes: 1 addition & 1 deletion tests/Ddeboer/Imap/Tests/ServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ public function testFailedAuthenticate()
$server = new Server('imap.gmail.com');
$server->authenticate('fake_username', 'fake_password');
}
}
}
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
");
}

$loader = require $vendorDir . '/autoload.php';
$loader = require $vendorDir . '/autoload.php';

0 comments on commit 9bb97e6

Please sign in to comment.