original_string: private function saveJobStates()
      {
          $now = time();
          $new_states = [];
  
          foreach ($this->jobs_run as $job) {
              if ($job->isSuccessful()) {
                  $new_states[$job->getId()] = ['state' => 'success', 'last-run' => $now];
                  $this->pushExecutedJob($job);
              } else {
                  $new_states[$job->getId()] = ['state' => 'failure', 'last-run' => $now, 'error' => $job->getOutput()];
                  $this->pushFailedJob($job);
              }
          }
  
          $saved_states = $this->getJobStates();
          $saved_states->save(array_merge($saved_states->content(), $new_states));
      }
code: private function saveJobStates()
      {
          $now = time();
          $new_states = [];
  
          foreach ($this->jobs_run as $job) {
              if ($job->isSuccessful()) {
                  $new_states[$job->getId()] = ['state' => 'success', 'last-run' => $now];
                  $this->pushExecutedJob($job);
              } else {
                  $new_states[$job->getId()] = ['state' => 'failure', 'last-run' => $now, 'error' => $job->getOutput()];
                  $this->pushFailedJob($job);
              }
          }
  
          $saved_states = $this->getJobStates();
          $saved_states->save(array_merge($saved_states->content(), $new_states));
      }
code_tokens: private function saveJobStates ( ) { $ now = time ( ) ; $ new_states = [ ] ; foreach ( $ this -> jobs_run as $ job ) { if ( $ job -> isSuccessful ( ) ) { $ new_states [ $ job -> getId ( ) ] = [ 'state' => 'success' , 'last-run' => $ now ] ; $ this -> pushExecutedJob ( $ job ) ; } else { $ new_states [ $ job -> getId ( ) ] = [ 'state' => 'failure' , 'last-run' => $ now , 'error' => $ job -> getOutput ( ) ] ; $ this -> pushFailedJob ( $ job ) ; } } $ saved_states = $ this -> getJobStates ( ) ; $ saved_states -> save ( array_merge ( $ saved_states -> content ( ) , $ new_states ) ) ; }
docstring: Save job states to statys file
docstring_tokens: Save job states to statys file