original_string: public function setPayload($data)
      {
          if (!is_string($data)) {
              if (is_array($data)) {
                  $data = json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
              } else {
                  $data = serialize($data);
              }
          }
  
          $maxLength = 255;
          if (mb_strlen($data) > $maxLength) {
              // Truncate too long payload
              $data = mb_substr($data, 0, $maxLength - 3) . '...';
          }
  
          $this->payload = $data ? $data : null;
  
          return $this;
      }
code: public function setPayload($data)
      {
          if (!is_string($data)) {
              if (is_array($data)) {
                  $data = json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
              } else {
                  $data = serialize($data);
              }
          }
  
          $maxLength = 255;
          if (mb_strlen($data) > $maxLength) {
              // Truncate too long payload
              $data = mb_substr($data, 0, $maxLength - 3) . '...';
          }
  
          $this->payload = $data ? $data : null;
  
          return $this;
      }
code_tokens: public function setPayload ( $ data ) { if ( ! is_string ( $ data ) ) { if ( is_array ( $ data ) ) { $ data = json_encode ( $ data , JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ) ; } else { $ data = serialize ( $ data ) ; } } $ maxLength = 255 ; if ( mb_strlen ( $ data ) > $ maxLength ) { // Truncate too long payload $ data = mb_substr ( $ data , 0 , $ maxLength - 3 ) . '...' ; } $ this -> payload = $ data ? $ data : null ; return $ this ; }
docstring: Set payload value
  
  @param mixed $data [1, 4, 5] or "1,4,5" or Object
  
  @return $this
docstring_tokens: Set payload value