/** * @param ParaunitProcessInterface $process * @return array | \stdClass[] */ public function fetch(ParaunitProcessInterface $process) { $filePath = $this->fileName->getFilenameForLog($process->getUniqueId()); $fileContent = ''; if (file_exists($filePath)) { $fileContent = file_get_contents($filePath); unlink($filePath); } $logs = json_decode($this->cleanLog($fileContent)); $logs[] = $this->createLogEnding(); return $logs; }