mapdev\FacebookMessenger\Exceptions\CouldNotCreateMessage::noActionDefined PHP Метод

noActionDefined() публичный статический Метод

public static noActionDefined ( )
    public static function noActionDefined()
    {
        return new static('You must define an Action');
    }

Usage Example

 public function toArray()
 {
     $this->checkRecipient();
     if (is_null($this->action)) {
         throw CouldNotCreateMessage::noActionDefined();
     }
     return ['recipient' => ['id' => $this->recipient_id], 'sender_action' => $this->action];
     //return array
     //check null action
 }