Use strict type hinting in all tests.
All checks were successful
The build was successful.

This commit is contained in:
Rafal Kupiec 2018-09-14 21:32:08 +02:00
parent 8b48786f29
commit ca00cadba7
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
5 changed files with 6 additions and 6 deletions

View File

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

View File

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

View File

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

View File

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

View File

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