/**
  * Adds an ImapMessage object to the collection
  * @param Collectable $message
  * @param string $key
  * @throws InvalidArgumentException
  * @return void
  */
 public function add(Collectable $message, $key = null)
 {
     if ($message instanceof ImapMessage) {
         parent::add($message, $key);
     } else {
         throw new InvalidArgumentException('ImapMessage object expected');
     }
 }
 /**
  * Adds a Folder object to the collection
  * @param Collectable $folder
  * @param string $key
  * @throws InvalidArgumentException
  * @return void
  */
 public function add(Collectable $folder, $key = null)
 {
     if ($folder instanceof Folder) {
         parent::add($folder, $key);
     } else {
         throw new InvalidArgumentException('Folder object expected');
     }
 }
 /**
  * Adds an Attachment object to the collection
  * @param Collectable $attachment
  * @param string $key
  * @throws InvalidArgumentException
  * @return void
  */
 public function add(Collectable $attachment, $key = null)
 {
     if ($attachment instanceof ImapAttachment) {
         parent::add($attachment, $key);
     } else {
         throw new InvalidArgumentException('Attachment object expected');
     }
 }
 /**
  * Adds an EmailAddress object to the collection
  * @param Collectable $email
  * @param string $key
  * @throws InvalidArgumentException
  * @return void
  */
 public function add(Collectable $email, $key = null)
 {
     if ($email instanceof EmailAddress) {
         parent::add($email, $key);
     } else {
         throw new InvalidArgumentException('EmailAddress object expected');
     }
 }