diff --git a/src/Engine.php b/src/Engine.php index d138dae..52c105e 100644 --- a/src/Engine.php +++ b/src/Engine.php @@ -10,7 +10,7 @@ const MIN_NUM = 1; const MAX_NUM = 100; -function communication(array $answers, $game): void +function communication(array $answers, string $game): void { $name = greeting(); line("$game"); diff --git a/src/Games/Calc.php b/src/Games/Calc.php index fd2fe1e..5356aca 100644 --- a/src/Games/Calc.php +++ b/src/Games/Calc.php @@ -21,17 +21,14 @@ function calc(): void } communication($answers, $game); } -function calculate($num1, $num2, $operation) +function calculate(int $num1, int $num2, string $operation) { switch ($operation) { case '+': return $num1 + $num2; - break; case '-': return $num1 - $num2; - break; case '*': return $num1 * $num2; - break; } } diff --git a/src/Games/Even.php b/src/Games/Even.php index de7535f..bff4889 100644 --- a/src/Games/Even.php +++ b/src/Games/Even.php @@ -19,7 +19,7 @@ function even(): void communication($answers, $game); } -function isEven($num): bool +function isEven(int $num): bool { return $num % 2 === 0; } diff --git a/src/Games/GCD.php b/src/Games/GCD.php index dfed50b..cf30127 100644 --- a/src/Games/GCD.php +++ b/src/Games/GCD.php @@ -20,7 +20,7 @@ function gcd(): void communication($answers, $game); } -function nod($x, $y) +function nod(int $x, int $y) { while ($x != 0 && $y != 0) { if ($x >= $y) {