original_string: public function serialize($jobId, $class, $args = [], $retry = true, $queue = null)
      {
          $class = is_object($class) ? get_class($class) : $class;
  
          $data = [
              'class' => $class,
              'jid' => $jobId,
              'created_at' => microtime(true),
              'enqueued_at' => microtime(true),
              'args' => $args,
              'retry' => $retry,
          ];
  
          if ($queue !== null) {
              $data['queue'] = $queue;
          }
  
          $jsonEncodedData = json_encode($data);
  
          if ($jsonEncodedData === false) {
              throw new JsonEncodeException($data, json_last_error(), json_last_error_msg());
          }
  
          return $jsonEncodedData;
      }
code: public function serialize($jobId, $class, $args = [], $retry = true, $queue = null)
      {
          $class = is_object($class) ? get_class($class) : $class;
  
          $data = [
              'class' => $class,
              'jid' => $jobId,
              'created_at' => microtime(true),
              'enqueued_at' => microtime(true),
              'args' => $args,
              'retry' => $retry,
          ];
  
          if ($queue !== null) {
              $data['queue'] = $queue;
          }
  
          $jsonEncodedData = json_encode($data);
  
          if ($jsonEncodedData === false) {
              throw new JsonEncodeException($data, json_last_error(), json_last_error_msg());
          }
  
          return $jsonEncodedData;
      }
code_tokens: public function serialize ( $ jobId , $ class , $ args = [ ] , $ retry = true , $ queue = null ) { $ class = is_object ( $ class ) ? get_class ( $ class ) : $ class ; $ data = [ 'class' => $ class , 'jid' => $ jobId , 'created_at' => microtime ( true ) , 'enqueued_at' => microtime ( true ) , 'args' => $ args , 'retry' => $ retry , ] ; if ( $ queue !== null ) { $ data [ 'queue' ] = $ queue ; } $ jsonEncodedData = json_encode ( $ data ) ; if ( $ jsonEncodedData === false ) { throw new JsonEncodeException ( $ data , json_last_error ( ) , json_last_error_msg ( ) ) ; } return $ jsonEncodedData ; }
docstring: Serialize and normalize job data
  
  @param string        $jobId
  @param object|string $class
  @param array         $args
  @param bool          $retry
  @param string|null   $queue
  
  @return string
  @throws JsonEncodeException
docstring_tokens: Serialize and normalize job data