Skip to content

Commit 7ed7137

Browse files
committed
Address review comments
1 parent 7633e7b commit 7ed7137

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

Zend/tests/type_declarations/scalar_null.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ $functions = [
88
'float' => function (float $f) { return $f; },
99
'string' => function (string $s) { return $s; },
1010
'bool' => function (bool $b) { return $b; },
11-
'int nullable' => function (?int $i = NULL) { return $i; },
12-
'float nullable' => function (?float $f = NULL) { return $f; },
13-
'string nullable' => function (?string $s = NULL) { return $s; },
14-
'bool nullable' => function (?bool $b = NULL) { return $b; }
11+
'int nullable' => function (?int $i) { return $i; },
12+
'float nullable' => function (?float $f) { return $f; },
13+
'string nullable' => function (?string $s) { return $s; },
14+
'bool nullable' => function (?bool $b) { return $b; }
1515
];
1616

1717
foreach ($functions as $type => $function) {

Zend/tests/variadic/adding_additional_optional_parameter.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ interface DB {
88
}
99

1010
class MySQL implements DB {
11-
public function query($query, string $extraParam = null, string ...$params) { }
11+
public function query($query, ?string $extraParam = null, string ...$params) { }
1212
}
1313

1414
?>
1515
===DONE===
1616
--EXPECTF--
17-
Deprecated: Implicitly marking parameter $extraParam as nullable is deprecated, the explicit nullable type must be used instead in %s on line %d
1817
===DONE===

Zend/tests/variadic/adding_additional_optional_parameter_error.phpt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ interface DB {
88
}
99

1010
class MySQL implements DB {
11-
public function query($query, int $extraParam = null, string ...$params) { }
11+
public function query($query, ?int $extraParam = null, string ...$params) { }
1212
}
1313

1414
?>
1515
--EXPECTF--
16-
Deprecated: Implicitly marking parameter $extraParam as nullable is deprecated, the explicit nullable type must be used instead in %s on line %d
17-
1816
Fatal error: Declaration of MySQL::query($query, ?int $extraParam = null, string ...$params) must be compatible with DB::query($query, string ...$params) in %s on line %d

ext/reflection/tests/ReflectionClass_export_basic1.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Class A {
1111
$e = "15 chars long -",
1212
$f = null,
1313
$g = false,
14-
?array $h = null) {}
14+
array $h = null) {}
1515
}
1616

1717
Class C extends A { }
@@ -20,6 +20,7 @@ define('K', "16 chars long --");
2020
echo new ReflectionClass("C"), "\n";
2121
?>
2222
--EXPECTF--
23+
Deprecated: Implicitly marking parameter $h as nullable is deprecated, the explicit nullable type must be used instead in %s on line %d
2324
Class [ <user> class C extends A ] {
2425
@@ %s 14-14
2526

ext/reflection/tests/parameters_002.phpt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function test($nix, Array $ar, &$ref, stdClass $std,
1111
class test
1212
{
1313
function method($nix, Array $ar, &$ref, stdClass $std,
14-
NonExistingClass $na, stdClass $opt = NULL, $def = "FooBar")
14+
NonExistingClass $na, ?stdClass $opt = NULL, $def = "FooBar")
1515
{
1616
}
1717
}
@@ -73,8 +73,6 @@ check_params(ReflectionMethod::createFromMethodName('test::method'));
7373

7474
?>
7575
--EXPECTF--
76-
Deprecated: Implicitly marking parameter $opt as nullable is deprecated, the explicit nullable type must be used instead in %s on line %d
77-
7876
Deprecated: Implicitly marking parameter $opt as nullable is deprecated, the explicit nullable type must be used instead in %s on line %d
7977
#####test()#####
8078
===0===

0 commit comments

Comments
 (0)