lib/Job.php
static function fromJson(object $map): self {
    return (new static(isset($map->source_files) && is_array($map->source_files) ? array_map([SourceFile::class, 'fromJson'], $map->source_files) : []))
      ->setCommitSha(isset($map->commit_sha) && is_string($map->commit_sha) ? $map->commit_sha : '')
      ->setGit(isset($map->git) && is_object($map->git) ? GitData::fromJson($map->git) : null)
      ->setParallel(isset($map->parallel) && is_bool($map->parallel) ? $map->parallel : false)
      ->setRepoToken(isset($map->repo_token) && is_string($map->repo_token) ? $map->repo_token : '')
      ->setRunAt(isset($map->run_at) && is_string($map->run_at) ? new \DateTime($map->run_at) : null)
      ->setServiceJobId(isset($map->service_job_id) && is_string($map->service_job_id) ? $map->service_job_id : '')
      ->setServiceName(isset($map->service_name) && is_string($map->service_name) ? $map->service_name : '')
      ->setServiceNumber(isset($map->service_number) && is_string($map->service_number) ? $map->service_number : '')
      ->setServicePullRequest(isset($map->service_pull_request) && is_string($map->service_pull_request) ? $map->service_pull_request : '');
  }
static function fromJson(object $map): self {
    return (new static(isset($map->source_files) && is_array($map->source_files) ? array_map([SourceFile::class, 'fromJson'], $map->source_files) : []))
      ->setCommitSha(isset($map->commit_sha) && is_string($map->commit_sha) ? $map->commit_sha : '')
      ->setGit(isset($map->git) && is_object($map->git) ? GitData::fromJson($map->git) : null)
      ->setParallel(isset($map->parallel) && is_bool($map->parallel) ? $map->parallel : false)
      ->setRepoToken(isset($map->repo_token) && is_string($map->repo_token) ? $map->repo_token : '')
      ->setRunAt(isset($map->run_at) && is_string($map->run_at) ? new \DateTime($map->run_at) : null)
      ->setServiceJobId(isset($map->service_job_id) && is_string($map->service_job_id) ? $map->service_job_id : '')
      ->setServiceName(isset($map->service_name) && is_string($map->service_name) ? $map->service_name : '')
      ->setServiceNumber(isset($map->service_number) && is_string($map->service_number) ? $map->service_number : '')
      ->setServicePullRequest(isset($map->service_pull_request) && is_string($map->service_pull_request) ? $map->service_pull_request : '');
  }
static function fromJson ( object $ map ) : self { return ( new static ( isset ( $ map -> source_files ) && is_array ( $ map -> source_files ) ? array_map ( [ SourceFile :: class , 'fromJson' ] , $ map -> source_files ) : [ ] ) ) -> setCommitSha ( isset ( $ map -> commit_sha ) && is_string ( $ map -> commit_sha ) ? $ map -> commit_sha : '' ) -> setGit ( isset ( $ map -> git ) && is_object ( $ map -> git ) ? GitData :: fromJson ( $ map -> git ) : null ) -> setParallel ( isset ( $ map -> parallel ) && is_bool ( $ map -> parallel ) ? $ map -> parallel : false ) -> setRepoToken ( isset ( $ map -> repo_token ) && is_string ( $ map -> repo_token ) ? $ map -> repo_token : '' ) -> setRunAt ( isset ( $ map -> run_at ) && is_string ( $ map -> run_at ) ? new \ DateTime ( $ map -> run_at ) : null ) -> setServiceJobId ( isset ( $ map -> service_job_id ) && is_string ( $ map -> service_job_id ) ? $ map -> service_job_id : '' ) -> setServiceName ( isset ( $ map -> service_name ) && is_string ( $ map -> service_name ) ? $ map -> service_name : '' ) -> setServiceNumber ( isset ( $ map -> service_number ) && is_string ( $ map -> service_number ) ? $ map -> service_number : '' ) -> setServicePullRequest ( isset ( $ map -> service_pull_request ) && is_string ( $ map -> service_pull_request ) ? $ map -> service_pull_request : '' ) ; }
Creates a new job from the specified JSON map.
@param object $map A JSON map representing a job.
@return static The instance corresponding to the specified JSON map.
Creates a new job from the specified JSON map .