original_string: public function actionSend($id)
      {
          $message = Message::findOne($id);
          if ($message !== null) {
              try {
                  $message->status = $this->send($message) > 0 ? Message::STATUS_SUCCESS : Message::STATUS_ERROR;
                  $message->save(true, ['status']);
              } catch (\Exception $e) {
                  $message->status = Message::STATUS_ERROR;
                  $message->save(true, ['status']);
                  $this->stderr($e->getMessage());
              }
          } else {
              $this->stdout("Message not found\n");
              exit(1);
          }
      }
code: public function actionSend($id)
      {
          $message = Message::findOne($id);
          if ($message !== null) {
              try {
                  $message->status = $this->send($message) > 0 ? Message::STATUS_SUCCESS : Message::STATUS_ERROR;
                  $message->save(true, ['status']);
              } catch (\Exception $e) {
                  $message->status = Message::STATUS_ERROR;
                  $message->save(true, ['status']);
                  $this->stderr($e->getMessage());
              }
          } else {
              $this->stdout("Message not found\n");
              exit(1);
          }
      }
code_tokens: public function actionSend ( $ id ) { $ message = Message :: findOne ( $ id ) ; if ( $ message !== null ) { try { $ message -> status = $ this -> send ( $ message ) > 0 ? Message :: STATUS_SUCCESS : Message :: STATUS_ERROR ; $ message -> save ( true , [ 'status' ] ) ; } catch ( \ Exception $ e ) { $ message -> status = Message :: STATUS_ERROR ; $ message -> save ( true , [ 'status' ] ) ; $ this -> stderr ( $ e -> getMessage ( ) ) ; } } else { $ this -> stdout ( "Message not found\n" ) ; exit ( 1 ) ; } }
docstring: Send the message by id
  @param int $id the message id
docstring_tokens: Send the message by id