Skip to content

Commit 35b9ed5

Browse files
committed
Fix tests
1 parent 500b7ad commit 35b9ed5

File tree

219 files changed

+600
-593
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+600
-593
lines changed

Zend/tests/bug21478.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Bug #21478 (Zend/zend_alloc.c :: shutdown_memory_manager produces segfault)
33
--FILE--
44
<?php
55
class debugfilter extends php_user_filter {
6-
function filter($in, $out, &$consumed, $closing) {
6+
function filter($in, $out, &$consumed, $closing): int {
77
while ($bucket = stream_bucket_make_writeable($in)) {
88
$bucket->data = strtoupper($bucket->data);
99
stream_bucket_append($out, $bucket);

Zend/tests/bug78406.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (!class_exists(SampleFilter::class)) {
1010
{
1111
private $data = '';
1212

13-
public function filter($in, $out, &$consumed, $closing)
13+
public function filter($in, $out, &$consumed, $closing): int
1414
{
1515
while ($bucket = stream_bucket_make_writeable($in))
1616
{

Zend/tests/enum/json_encode.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ enum StringFoo: string {
1818
enum CustomFoo implements JsonSerializable {
1919
case Bar;
2020

21-
public function jsonSerialize() {
21+
public function jsonSerialize(): mixed {
2222
return 'Custom ' . $this->name;
2323
}
2424
}

Zend/tests/foreach_004.phpt

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,26 @@ class IT extends ArrayIterator {
1616
}
1717
}
1818

19-
function rewind() {$this->trap(__FUNCTION__); return parent::rewind();}
20-
function valid() {$this->trap(__FUNCTION__); return parent::valid();}
21-
function key() {$this->trap(__FUNCTION__); return parent::key();}
22-
function next() {$this->trap(__FUNCTION__); return parent::next();}
19+
function rewind(): void
20+
{
21+
$this->trap(__FUNCTION__);
22+
parent::rewind();
23+
}
24+
25+
function valid(): bool {
26+
$this->trap(__FUNCTION__);
27+
return parent::valid();
28+
}
29+
30+
function key(): mixed {
31+
$this->trap(__FUNCTION__);
32+
return parent::key();
33+
}
34+
35+
function next(): void {
36+
$this->trap(__FUNCTION__);
37+
parent::next();
38+
}
2339
}
2440

2541
foreach(['rewind', 'valid', 'key', 'next'] as $trap) {

Zend/tests/iterator_key_by_ref.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Iterator::key() with by-ref return
33
--FILE--
44
<?php
55
class Test extends ArrayIterator {
6-
function &key() {
6+
function &key(): mixed {
77
return $foo;
88
}
99
}

Zend/tests/ns_054.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
namespace test\ns1;
66

77
class Foo implements \SplObserver {
8-
function update(\SplSubject $x) {
8+
function update(\SplSubject $x): void {
99
echo "ok\n";
1010
}
1111
}
1212

1313
class Bar implements \SplSubject {
14-
function attach(\SplObserver $x) {
14+
function attach(\SplObserver $x): void {
1515
echo "ok\n";
1616
}
17-
function notify() {
17+
function notify(): void {
1818
}
19-
function detach(\SplObserver $x) {
19+
function detach(\SplObserver $x): void {
2020
}
2121
}
2222
$foo = new Foo();

Zend/tests/ns_056.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ namespace test\ns1;
66
use \SplObserver;
77

88
class Foo implements SplObserver {
9-
function update(\SplSubject $x) {
9+
function update(\SplSubject $x): void {
1010
echo "ok\n";
1111
}
1212
}
1313

1414
class Bar implements \SplSubject {
15-
function attach(SplObserver $x) {
15+
function attach(SplObserver $x): void {
1616
echo "ok\n";
1717
}
18-
function notify() {
18+
function notify(): void {
1919
}
20-
function detach(SplObserver $x) {
20+
function detach(SplObserver $x): void {
2121
}
2222
}
2323
$foo = new Foo();

Zend/tests/parameter_default_values/internal_declaration_error_class_const.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ The default value is a class constant in the parent class method's signature.
44
<?php
55
class MyDateTimeZone extends DateTimeZone
66
{
7-
public static function listIdentifiers()
7+
public static function listIdentifiers(): array
88
{
99
}
1010
}
1111
?>
1212
--EXPECTF--
13-
Fatal error: Declaration of MyDateTimeZone::listIdentifiers() must be compatible with DateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null) in %s on line %d
13+
Fatal error: Declaration of MyDateTimeZone::listIdentifiers(): array must be compatible with DateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): array in %s on line %d

Zend/tests/parameter_default_values/internal_declaration_error_const.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ The default value is a constant in the parent class method's signature.
44
<?php
55
class MyDateTimeZone extends DateTimeZone
66
{
7-
public function getTransitions()
7+
public function getTransitions(): array|false
88
{
99
}
1010
}
1111
?>
1212
--EXPECTF--
13-
Fatal error: Declaration of MyDateTimeZone::getTransitions() must be compatible with DateTimeZone::getTransitions(int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX) in %s on line %d
13+
Fatal error: Declaration of MyDateTimeZone::getTransitions(): array|false must be compatible with DateTimeZone::getTransitions(int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX): array|false in %s on line %d

Zend/tests/parameter_default_values/internal_declaration_error_false.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ The default value is false in the parent class method's signature.
55

66
interface MyDateTimeInterface extends DateTimeInterface
77
{
8-
public function diff();
8+
public function diff(): DateInterval|false;
99
}
1010
?>
1111
--EXPECTF--
12-
Fatal error: Declaration of MyDateTimeInterface::diff() must be compatible with DateTimeInterface::diff(DateTimeInterface $targetObject, bool $absolute = false) in %s on line %d
12+
Fatal error: Declaration of MyDateTimeInterface::diff(): DateInterval|false must be compatible with DateTimeInterface::diff(DateTimeInterface $targetObject, bool $absolute = false): DateInterval|false in %s on line %d

0 commit comments

Comments
 (0)