add find to fake scheduled node repo

This commit is contained in:
Yisroel Baum 2026-03-01 11:56:35 +02:00
parent a32989334e
commit 309c085007
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -23,7 +23,17 @@ class FakeScheduledNodeRepository implements ScheduledNodeRepository
return $scheduledNode;
}
public function nextId(): int
public function find(int $id): ?ScheduledNode
{
return array_find(
$this->existingScheduledNodes,
function (ScheduledNode $scheduledNode) use ($id) {
return $scheduledNode->getId() === $id;
}
);
}
private function nextId(): int
{
return count($this->existingScheduledNodes);
}