From 8782b9c25b2952f286b363b63cb1e2be87a2116d Mon Sep 17 00:00:00 2001 From: belliash Date: Mon, 26 Nov 2018 14:41:41 +0100 Subject: [PATCH] Update tests to use more strict data types instead of mixed. --- tests/arab_to_roman.aer | 4 ++-- tests/unicode_characters.aer | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/arab_to_roman.aer b/tests/arab_to_roman.aer index 61e9cfc..5bb0a6c 100644 --- a/tests/arab_to_roman.aer +++ b/tests/arab_to_roman.aer @@ -3,13 +3,13 @@ class Program { private function num2Roman(int $num) { int $n = intval($num); string $result = ''; - mixed $lookup = array('M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, + int[] $lookup = array('M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, 'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40, 'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1); int $matches; foreach($lookup as $roman => $value) { - $matches = intval($n / $value); + $matches = intval($n / $value); $result += str_repeat($roman, $matches); $n = $n % $value; } diff --git a/tests/unicode_characters.aer b/tests/unicode_characters.aer index e2771ac..437fd87 100644 --- a/tests/unicode_characters.aer +++ b/tests/unicode_characters.aer @@ -1,8 +1,8 @@ class Unicode { public function unicon(string $str, bool $to_uni = true) { - mixed $cpp; - mixed $cp = array('А' => 'А', 'а' => 'а', + string $cpp; + string[] $cp = array('А' => 'А', 'а' => 'а', "Б" => "Б", "б" => "б", "В" => "В", "в" => "в", "Г" => "Г", "г" => "г",