src/MailMap/Query.php
public function get(ConnectionContract $connection, MailFactoryContract $factory)
    {
        $uids = $connection->search($this->parseSearch());
        $stream = $connection->getStream();

        $max = $this->limit > 0 ? $this->limit : self::$max;
        $uids = array_slice($uids, 0, $max);

        return array_map(function ($uid) use ($factory, $stream) {
            return $factory->create($uid, $stream);
        }, $uids);
    }
public function get(ConnectionContract $connection, MailFactoryContract $factory)
    {
        $uids = $connection->search($this->parseSearch());
        $stream = $connection->getStream();

        $max = $this->limit > 0 ? $this->limit : self::$max;
        $uids = array_slice($uids, 0, $max);

        return array_map(function ($uid) use ($factory, $stream) {
            return $factory->create($uid, $stream);
        }, $uids);
    }
public function get ( ConnectionContract $ connection , MailFactoryContract $ factory ) { $ uids = $ connection -> search ( $ this -> parseSearch ( ) ) ; $ stream = $ connection -> getStream ( ) ; $ max = $ this -> limit > 0 ? $ this -> limit : self :: $ max ; $ uids = array_slice ( $ uids , 0 , $ max ) ; return array_map ( function ( $ uid ) use ( $ factory , $ stream ) { return $ factory -> create ( $ uid , $ stream ) ; } , $ uids ) ; }
Execute search query on connection and put
results into Mail wrappers using factory

@param \MailMap\Contracts\Connection $connection
@param \MailMap\Contracts\MailFactory $factory
@return array List of Mail wrappers
Execute search query on connection and put results into Mail wrappers using factory