ensureTask($jobId, $taskId); return $this->images->findForTask($taskId, $imageId) ?? throw new TaskImageNotFound($taskId, $imageId); } /** * @throws TaskNotFound */ public function ensureTask(int $jobId, int $taskId): void { if ($this->tasks->findForJob($jobId, $taskId) === null) { throw new TaskNotFound($jobId, $taskId); } } }