From de744c9b15d2aab28722984ac88469460fdd9d5f Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Mon, 23 Feb 2026 10:41:06 +0200 Subject: [PATCH] plan repo with create method --- app/Plan/CreatePlanDto.php | 10 ++++++++++ app/Plan/PlanRepository.php | 8 ++++++++ tests/Fakes/FakePlanRepository.php | 29 +++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 app/Plan/CreatePlanDto.php create mode 100644 app/Plan/PlanRepository.php create mode 100644 tests/Fakes/FakePlanRepository.php diff --git a/app/Plan/CreatePlanDto.php b/app/Plan/CreatePlanDto.php new file mode 100644 index 0000000..5aed171 --- /dev/null +++ b/app/Plan/CreatePlanDto.php @@ -0,0 +1,10 @@ +nextId(); + $plan = new Plan( + id: $id, + name: $dto->name, + ); + $this->existingPlans[$id] = $plan; + + return $plan; + } + + private function nextId(): int + { + return count($this->existingPlans); + } +}