add find to fake scheduled node repo
This commit is contained in:
parent
a32989334e
commit
309c085007
1 changed files with 11 additions and 1 deletions
|
|
@ -23,7 +23,17 @@ class FakeScheduledNodeRepository implements ScheduledNodeRepository
|
||||||
return $scheduledNode;
|
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);
|
return count($this->existingScheduledNodes);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue