/** * Count messages all messages in current box * * @return int number of messages * @throws \Zend\Mail\Storage\Exception * @throws \Zend\Mail\Protocol\Exception */ public function countMessages() { $count = null; // "Declare" variable before first usage. $octets = null; // "Declare" variable since it's passed by reference $this->_protocol->status($count, $octets); return (int)$count; }