add find method to plan

This commit is contained in:
Yisroel Baum 2026-02-25 10:17:13 +02:00
parent 412a74e390
commit 449df516ae
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
2 changed files with 11 additions and 0 deletions

View file

@ -27,4 +27,14 @@ class FakePlanRepository implements PlanRepository
{
return count($this->existingPlans);
}
public function find(int $id): ?Plan
{
return array_find(
$this->existingPlans,
function (Plan $plan) use ($id) {
return $plan->getId() === $id;
}
);
}
}