My attempts at exercism.org
1<?php
2
3class Lasagna
4{
5 public function expectedCookTime(): int
6 {
7 return 40;
8 }
9
10 public function remainingCookTime($elapsed_minutes): int
11 {
12 return $this->expectedCookTime() - $elapsed_minutes;
13 }
14
15 public function totalPreparationTime($layers_to_prep): int
16 {
17 return $layers_to_prep * 2;
18 }
19
20 public function totalElapsedTime($layers_to_prep, $elapsed_minutes): int
21 {
22 return $this->totalPreparationTime($layers_to_prep) + ($this->expectedCookTime() - $this->remainingCookTime($elapsed_minutes));
23 }
24
25 public function alarm(): string
26 {
27 return "Ding!";
28 }
29}