getQuery(); $stuckTasks = $this->findStuckTasks(); $report = Report::createSuccess( sprintf( 'Total = %s, Age <= %s, TasksName = %s', $stuckTasks->count(), $query->getAgeDateTime()->format(DATE_ATOM), implode(',', $query->getWhitelist()) ) ); foreach ($stuckTasks as $stuckTask) { $task = $stuckTask->getTask(); $taskLog = $stuckTask->getTaskLog(); $report->add( Report::createInfo( sprintf( '[%s][%s/%s]: Label = %s, TaskName = %s, IsOrphan = %s, TaskId = %s, TaskCreatedAt = %s', $taskLog->getId(), $taskLog->getCreatedAt()->format(DATE_ATOM), $taskLog->getUpdatedAt()->format(DATE_ATOM), $taskLog->getLabel(), $taskLog->getTaskName(), $stuckTask->isOrphan() ? 'Yes' : 'No', $task ? $task->getId() : 'None', $task ? $task->getCreatedAt()->format(DATE_ATOM) : 'None' ) ) ); } return $report; } }