public function setAttachments($attachments)
{
if (is_array($attachments)) {
$this->attachments = new AttachmentsOptions($attachments);
} elseif ($attachments instanceof AttachmentsOptions) {
$this->attachments = $attachments;
} else {
throw new InvalidArgumentException(sprintf('Attachments should be an array or an AcMailer\\Options\\AttachmentsOptions, %s provided', is_object($attachments) ? get_class($attachments) : gettype($attachments)));
}
return $this;
}