@param $messageArg array|string

@return $this|null
13731
public function setMessageArg($messageArg)
    {

        $messageArg = (array) $messageArg;

        /**
         * Check on empty argument and check if
         * passed argument is not equal to existence
         */
        if (empty($messageArg)
            || $this->getData(self::P_MESSAGE_ARG) === $messageArg
        ) {
            return null;
        }

        $formattedMessage = vsprintf($this->message, $messageArg);

        if ($formattedMessage === $this->message) {
            // there are no any %s so we just append params
            $formattedMessage = ' [' . implode('] [', $messageArg) . ']';
        }
        $this->message = $formattedMessage;

        $this->data[self::P_MESSAGE_ARG] = $messageArg;

        return $this;
    }
688572
public static function argValue(ArgumentNode $arg, $default = null)
    {
        $valueNode = $arg->value;

        if (! $valueNode) {
            return $default;
        }

        return AST::valueFromASTUntyped($valueNode);
    }
976848
public function arg(string $arg): ProcessBuilder
    {
        if ($arg === '') {
            return $this;
        }

        $this->arguments[] = $arg;

        return $this;
    }
51783
public function setMessageHandler($callback = null)
    {
        if (!is_callable($callback)) {
            throw new InvalidArgumentException('Argument #2 is not callable.');
        }

        $this->messageHandler = $callback;

        return $this;
    }
929579
public static function notNull($argValue, $argName = '')
    {
        $valid = ($argValue !== null);
        if (!$valid) {
            $message = implode(' ', array_filter(['Argument', $argName, 'must not be null']));
            throw new \InvalidArgumentException($message);
        }
        return $valid;
    }
1108498
public function setArguments(array $args): PostTypeInterface
    {
        $this->args = array_merge($this->args, $args);

        return $this;
    }
1240341
public function update( array $args ) {

		switch ( current_filter() ) {
			case 'phpmailer_init' :
				return $this->on_mailer_init( $args );
			case 'wp_mail_failed' :
				return $this->on_mail_failed( $args );
		}

		return new NullLog();
	}
1353630
public function addMessage($item, $message = null)
    {
        if ($message === null || $message === '') {
            return $this;
        }
        if (!array_key_exists($item, $this->messages)) {
            $this->messages[$item] = array();
        }
        $this->messages[$item][] = $message;

        return $this;
    }
488773
public static function invalidArgument($message = null)
    {
        $defaultMessage = sprintf('Invalid argument passed in GameParameters.');
        $message = null === $message ? $defaultMessage : $message;

        return new static($message);
    }
973102
public function push(array $message, callable $messageHandler) {

        $this->beanstalkMapper->put(serialize(
            array_merge(
                $messageHandler(), $message
            )
        ));

        return null;
    }
1344716
public function setMediaId($arg) {
        if (empty($this->type)) {
            $this->setType(self::MEDIA);
        }
        $this->mediaId = $arg;
        return $this;
    }
439600
public function setKey($arg) {
        $this->setType(self::CLICK);
        $this->key = $arg;
        return $this;
    }
614439
public function setTraceMessage($traceMessage)
    {
        if (gettype($traceMessage) === 'string') {
            $this->traceMessage = $traceMessage;
        } else {
            $msg = "The traceMessage argument must be a string, '" . gettype($traceMessage) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
662630
protected function throwNewInvalidArgumentException ($errorMsg) {
		$selfClass = version_compare(PHP_VERSION, '5.5', '>') ? self::class : __CLASS__;
		$str = '['.$selfClass.'] ' . $errorMsg . ' ('
			. 'form id: `'.$this->id . '`, '
			. 'form type: `'.get_class($this->form).'`'
		.')';
		throw new \InvalidArgumentException($str);
	}
850794
public function setMessage($message)
    {
        if ($message === null) {
            $this->message = null;
        } elseif (is_scalar($message) || method_exists($message, '__toString')) {
            $this->message = (string) $message;
        } else {
            throw new InvalidArgumentException('The message must be a string.');
        }

        return $this;
    }
843948
public function setMessage($messageString, $messageKey = null)
    {
        if ($messageKey === null) {
            $keys = array_keys($this->_messageTemplates);
            $messageKey = current($keys);
        }
        if (!isset($this->_messageTemplates[$messageKey])) {
            include_once 'Zend/Validate/Exception.php';
            throw new Zend_Validate_Exception("No message template exists for key '$messageKey'");
        }
        $this->_messageTemplates[$messageKey] = $messageString;
        return $this;
    }
726537
private function on_mailer_init( array $args ) {

		$mailer = $args ? reset( $args ) : NULL;
		if ( $mailer instanceof \PHPMailer ) {
			$mailer->SMTPDebug   = 2;
			$mailer->Debugoutput = function ( $message ) {

				// Log the mailer debug message.
				do_action( \Inpsyde\Wonolog\LOG, new Debug( $message, Channels::HTTP ) );
			};
		}

		return new NullLog();
	}