Browse Source

Use strict type hinting in all tests.

pull/50/head
Rafal Kupiec 4 years ago
parent
commit
ca00cadba7
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
  1. 2
      tests/arab_to_roman.aer
  2. 4
      tests/debug_backtrace.aer
  3. 2
      tests/singleton_test.aer
  4. 2
      tests/unicode_characters.aer
  5. 2
      tests/utf8_variables.aer

2
tests/arab_to_roman.aer

@ -1,6 +1,6 @@
class Program {
private function num2Roman($num) {
private function num2Roman(int $num) {
$n = intval($num);
$result = '';
$lookup = array('M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400,

4
tests/debug_backtrace.aer

@ -4,7 +4,7 @@ class Program {
$this->b($this->a('First A'), $this->a('Second A'), $this->a('Third A'));
}
function a($p) {
function a(string $p) {
$backtrace = debug_backtrace();
if(isset($backtrace[0]['args'])) {
var_export($backtrace[0]['args']);
@ -14,7 +14,7 @@ class Program {
return $p;
}
function b($p1, $p2, $p3) {
function b(string $p1, string $p2, string $p3) {
print("$p1, $p2, $p3");
}

2
tests/singleton_test.aer

@ -17,7 +17,7 @@ final class Test {
return $this->value;
}
public function set($value = 0) {
public function set(int $value = 0) {
$this->value = $value;
}
}

2
tests/unicode_characters.aer

@ -1,6 +1,6 @@
class Unicode {
public function unicon($str, $to_uni = true) {
public function unicon(string $str, bool $to_uni = true) {
$cp = array('А' => 'А', 'а' => 'а',
"Б" => "Б", "б" => "б",
"В" => "В", "в" => "в",

2
tests/utf8_variables.aer

@ -12,7 +12,7 @@ class Program {
print($this->概要 + "\n");
}
private function isUTF8($str) {
private function isUTF8(string $str) {
$b = 0;
$c = 0;
$bits = 0;

Loading…
Cancel
Save