Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Made Server::getMessages() api more consistent by making it allways r…

…eturn an array.
  • Loading branch information...
commit fe83d77ed89004cb1ebd749c9a696664ed1b5e69 1 parent 812e4eb
@Lumbendil Lumbendil authored
Showing with 0 additions and 3 deletions.
  1. +0 −3  src/Fetch/Server.php
3  src/Fetch/Server.php
@@ -336,9 +336,6 @@ public function getMessages($limit = null)
if(isset($limit) && is_numeric($limit) && $limit < $numMessages)
$numMessages = $limit;
- if($numMessages < 1)
- return false;
$stream = $this->getImapStream();
$messages = array();
for($i = 1; $i <= $numMessages; $i++)

3 comments on commit fe83d77


Instead of removing those lines we should just return an empty array directly, rather than continuing those other calls against nothing.


I can do it. I just took the simpler option. It added close to no overhead, since it just got something already calculated, initializated an array, and then skipped the loop, but I'll change it to return an array.


@tedivm I had forgotten about this PR. I've updated the branch in order to make it mergeable.

Please sign in to comment.
Something went wrong with that request. Please try again.