添加短信接收者到当前列表的尾部

@param string|string[] $recipients
@throws \InvalidArgumentException
331000
protected function appendRecipient($recipients)
    {
        $recipients = static::formatRecipient($recipients);
        $this->recipients = array_merge($this->recipients, $recipients);
    }
66085
public void addEmailStats(final InternetAddress[] recipients, final boolean storageUsed) {
        this.storageUsed = storageUsed;
        for (InternetAddress recipient: recipients) {
            emailDests.add(recipient.getAddress());
        }
    }
440456
protected function setFields($fields)
    {
        if(is_array($fields)) {
            foreach ( $fields as $field ) {
                if ( !in_array($field, $this->fieldsWhitelist) ) {
                    throw new \InvalidArgumentException(sprintf('The field `%s` was not recognized.', $field));
                }
            }
        } elseif($fields === true) {
            $fields = $this->fieldsWhitelist;
        } else {
            throw new \InvalidArgumentException("The argument passed to setFields was invalid");
        }

        $this->setQueryParam('fields', $fields);
    }
959766
private function preloadSharingRolePermissions(array $subjects): void
    {
        if (null !== $this->sharingManager) {
            $this->sharingManager->preloadRolePermissions($subjects);
        }
    }
1223936
public function addHeader($headers)
    {
        foreach ((array) $headers as $header) {
            if (strpos($header, "\n") !== false || strpos($header, "\r") !== false) {
                throw new \InvalidArgumentException('Headers can not contain newline characters for security reasons');
            }
            $this->headers[] = $header;
        }

        return $this;
    }
1000317
public function setEmailAddress($emailAddress)
    {
        if ($emailAddress != null)
        {
            if (filter_var(trim($emailAddress), FILTER_VALIDATE_EMAIL) === false)
            {
                throw new InvalidArgumentException($emailAddress . " is not a valid email address.");
            }
        }

        $this->emailAddress = $emailAddress;
    }
1171548
public function setFromAddress($emailAddress)
    {
        if (filter_var($emailAddress, FILTER_VALIDATE_EMAIL) !== $emailAddress) {
            throw new \InvalidArgumentException('Invalid email address: '.$emailAddress);
        }
        $this->fromAddress = $emailAddress;
    }
1168237
public function send(array $vars = array())
    {
        if (count($this->getTo()) == 0) {
            throw new \InvalidArgumentException('A "To" email address is requried');
        }
        
        if ($this->getSubject() == '') {
            throw new \InvalidArgumentException('A subject for the email must be set');
        }
        
        if ($this->getMessage() == '') {
            throw new \InvalidArgumentException('There isn\'t a message set');
        }
        
        $valid_emails = array();
        foreach ($this->getTo() as $to) {
            if (filter_var(trim($to), FILTER_VALIDATE_EMAIL)) {
                $valid_emails[] = trim($to);
            }
        }
        
        if (! $valid_emails) {
            return;
        }
        
        $mailer = $this->getMailer();
        $subject = $this->getView()->render($this->getSubject(), $vars);
        $body_message = $this->getView()->render($this->getMessage(), $vars);
        $message = $mailer->getMessage($valid_emails, $this->config['from_email'], $this->config['sender_name'], $subject, $body_message, $this->getAttachments(), $this->getMailtype());
        
        if (! $mailer->send($message)) {
            throw new EmailException($this->getMailer()->ErrorInfo);
        }
        
        $this->clear();
    }
736072
public static function info(...$messages): void
    {
        static::init();

        if (!static::isTemporaryDisabled('info')) {
            foreach (static::$adapters as $adapter) {
                /* @var $adapter \Koldy\Log\Adapter\AbstractLogAdapter */
                if ($adapter->isLevelEnabled(self::INFO)) {
                    $adapter->info((new Message(self::INFO))->setMessages($messages));
                }
            }
        }
    }
100769
public function setExtensions( $extensions = array() )
	{
		if( !is_array( $extensions ) )
			throw new InvalidArgumentException( 'Extensions must be given as Array.' );

		$pattern	= "";
		if( count( $extensions ) )
		{
			$extensions	= implode( "|", array_values( $extensions ) );
			$pattern	= '@\.'.$extensions.'$@i';
		}
		$this->pattern	= $pattern;
	}
1116658
public function setExpressions(array $expressions)
    {
        foreach ($expressions as $expression) {
            if (! $expression instanceof AbstractExpression) {
                throw new \InvalidArgumentException(
                    'Error: Expected array of AbstractExpression but got something else'
                );
            }
        }

        $this->expressions = $expressions;
    }
805647
public static function normalizeRecipients($recipients): array
    {
        $targetRecipients = [];
        if (is_string($recipients)) {
            $targetRecipients[] = new Address($recipients);
        } elseif ($recipients instanceof Address) {
            $targetRecipients[] = $recipients;
        } elseif (is_iterable($recipients)) {
            foreach ($recipients as $key => $recipient) {
                if ($recipient instanceof Address) {
                    $targetRecipients[] = $recipient;
                } elseif (is_int($key)) {
                    $targetRecipients[] = new Address($recipient);
                } else {
                    $targetRecipients[] = new Address($key, $recipient);
                }
            }
        } else {
            throw new InvalidArgumentException('Expected string/array/Address instance/array of Address instances.');
        }

        return $targetRecipients;
    }
309528
protected function prepareListAddress(array &$addresses)
    {
        foreach ($addresses as &$address) {
            $address['translated'] = $this->address->getTranslated($address, true);
        }
    }
1211523
private function checkMessageResult($message, \ArrayIterator $recipients)
    {
        $hasDeviceError = false;

        $recipientCount = $recipients->count();

        for ($i = 0; $i <= $recipientCount; $i++) {
            if (isset($message->results[$i]['registration_id'])) {
                $hasDeviceError = true;
                $recipients->offsetGet($i)->setIdentifierToReplaceTo($message->results[$i]['registration_id']);
            }

            if (isset($message->results[$i]['error'])) {
                $hasDeviceError = true;
                $error = $message->results[$i]['error'];
                $this->processError($error, $recipients->offsetGet($i));
            }
        }

        if ($hasDeviceError) {
            throw new InvalidRecipientException("Device identifier error status", $recipients);
        }
    }
921835
public function setMessages($messages)
	{
		if (!is_array($messages))
		{
			throw new InvalidArgumentException(sprintf(
				'Messages must be an array. Type of "%s" passed.',
				gettype($messages)
			));
		}

		$this->_messages = $messages;

		return $this;
	}
708047
public function setModifiers(array $modifiers)
    {
        $modifiers = array_map('strtolower', $modifiers);

        // Validate modifiers are supported
        $allowed = $this->getSupportedModifiers();
        $unsupported = array_diff($modifiers, $allowed);
        if ($unsupported) {
            throw new InvalidArgumentException(
                static::class . ' does not accept ' . implode(', ', $unsupported) . ' as modifiers'
            );
        }

        $this->modifiers = $modifiers;
    }
423946
public static function fromArrays(array $arrays): ArrayTranslatorProvider {
        $ret = new static([]);

        foreach ($arrays as $lang => $translations) {
            if (is_array($translations)) {
                $ret->translators[$lang] = new Translator($translations, $lang);
            } else {
                throw new \InvalidArgumentException('$arrays must have string[][] type');
            }
        }

        return $ret;
    }