From 148641816acc3c930b1b9436afb1246938f8c28c Mon Sep 17 00:00:00 2001 From: gkdev Date: Sun, 10 Sep 2023 00:05:11 +0300 Subject: [PATCH] fix: errors after phpstan lint --- src/Engine.php | 2 +- src/Utils/ModuleUtils.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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