diff --git a/src/Engine.php b/src/Engine.php index 130c6b5..71a34d9 100644 --- a/src/Engine.php +++ b/src/Engine.php @@ -77,7 +77,7 @@ function runGame(array $module, int $correctAnswerCounter = 0): void [$question, $correctAnswer] = getQuestionAnswerPairHandler($module); line(getText($module, 'prompts.question', ['[question]' => $question])); $userAnswer = prompt(getText($module, 'prompts.answer')); - $isValidAnswer = $correctAnswer === $userAnswer; + $isValidAnswer = (string)$correctAnswer === $userAnswer; /** Game over */ if (!$isValidAnswer) { diff --git a/src/Utils/ModuleUtils.php b/src/Utils/ModuleUtils.php index c87f085..8b3f4b0 100644 --- a/src/Utils/ModuleUtils.php +++ b/src/Utils/ModuleUtils.php @@ -16,7 +16,7 @@ * * @return array{ * 0: string, - * 1: string + * 1: mixed * } */ function getQuestionAnswerPairHandler(array $module): array