@param null|string $message

@return static
198497
public static function turnHasBeenDealt($message = null)
    {
        $defaultMessage = 'The Turn has already been dealt!';
        $message = null === $message ? $defaultMessage : $message;

        return new static($message);
    }
970462
public function queue(Message $message)
	{
		// Bump the message ID
		$this->lastMessageId++;

		// Put the message in an envelope
		$envelope = new MessageEnvelope($this->lastMessageId, $message);

		// Save the message so we can update it later on
		$this->storeMessageEnvelope($envelope);

		// Queue and return the envelope
		$this->logger->debug('Queuing Apns\Message #' . $this->lastMessageId . ' to device "' . $message->getDeviceToken() . '" on Apns\Gateway with certificate "' . $this->getCertificate()->getDescription() . '"');
		$this->sendQueue->enqueue($envelope);

		return $envelope;
	}
1027714
public function set($type, $message)
    {
        $type = StaticFilter::filter('number', $type);
        if ($type < 0 || $type > 3) {
            $type = static::TYPE_INFO;
        }
        $this->_messages[$type][] = $message;
        $this->getSession()->set('_messages_', $this->_messages);
        return $this;
    }
1295410
public function release(QueueMessage $message)
    {
        $queue = $message->getQueueName() ?: $this->queue;

        $this->client->releaseMessage(
            $queue,
            $message->getId(),
            $message->get('reservation_id'),
            $message->getDelay()
        );

        return $this;
    }
879274
public function log($message)
    {
        $app = Base::instance();
        if ($app['LOG_FILE']) {
            if (null === $this->logger) {
                $this->logger = new Log($app['LOG_FILE']);
            }
            $this->logger->write($message);
        }

        return $this;
    }
16157
public static function __($message, $params = [], $language = null)
    {
        return Yii::t(static::$defaultContext, $message, $params, $language);
    }
1047853
public function setMessage(string $message)
    {
        if (strlen($message) > 0) {
            $properties = $this->getProperties();
            $properties['message'] = $message;
            $this->setProperties($properties);
            return $this;
        }
        return false;
    }
484878
public function setStatusMessage($message)
    {
        if($row = $this->getIterator()->current()) {
            $row->setStatusMessage($message);
        }

        return $this;
    }
126596
public function digits($message = null)
    {
        $this->setRule(__FUNCTION__, function($val)
                       {
                           return (strlen($val) === 0 || ctype_digit((string) $val));
                       }, $message);
        return $this;
    }
14227
public function exists( $message = null)
    {
        $this->setRule(__FUNCTION__, function ($val) {
            return null !== $val;
        }, $message);
        return $this;
    }
88792
public function addMessage($message, $status=null)
    {
        $messenger = $this->getMessenger();
        $messenger->addMessage($message, $status);

        return $this;
    }
1234224
public function getStoredConversation($message = null)
    {
        if (is_null($message)) {
            $message = $this->getMessage();
        }

        $conversation = $this->cache->get($message->getConversationIdentifier());
        if (is_null($conversation)) {
            $conversation = $this->cache->get($message->getOriginatedConversationIdentifier());
        }

        return $conversation;
    }
618875
public static function invalidMessage($message)
    {
        $type = is_object($message) ? get_class($message) : gettype($message);

        return new static('The message should be an instance of '.Message::class.". Given `{$type}` is invalid.", 1);
    }
695241
private function createMessage($message)
    {
        if ($message instanceof Message) {
            return $message;
        }

        if ($message instanceof Template) {
            $message = new Attachment(Attachment::TYPE_TEMPLATE, $message);
        }

        if (is_string($message) || $message instanceof Attachment) {
            return new Message($message);
        }

        throw new \InvalidArgumentException('$message should be a string, Message, Attachment or Template');
    }
399538
public function withErrors($errors, $message = null)
    {
        if (! $errors instanceof MessageBag) {
            $errors = new MessageBag((array) $errors);
        }

        if (! is_null($message)) {
            $errors->add('__message', $message);
        }

        $this->with('errors', $errors->toArray());

        return $this;
    }
1291418
public function message($name, $message='')
    {
        if (is_array($name)) {
            $this->message=array_merge($this->message, $name);
        } else {
            $this->message[$name]=$message;
        }
        return $this;
    }
1253485
public function setText($message) {
        if (empty($message)) {
            throw new \InvalidArgumentException('Message cannot be empty');
        }

        $this->message->setText($message);
        return $this;
    }