Skip to content

Commit 960318e

Browse files
committed
Change argument error message format
Closes GH-5211
1 parent c7094d8 commit 960318e

File tree

357 files changed

+1168
-1158
lines changed

Some content is hidden

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

357 files changed

+1168
-1158
lines changed

Zend/tests/008.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var_dump(constant("test const"));
2525
echo "Done\n";
2626
?>
2727
--EXPECTF--
28-
TypeError: define() expects argument #1 ($constant_name) to be of type string, array given
28+
TypeError: define(): Argument #1 ($constant_name) must be of type string, array given
2929

3030
Notice: Constant TRUE already defined in %s on line %d
3131
bool(false)

Zend/tests/009.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ string(3) "foo"
4646

4747
Warning: get_class() called without object from outside a class in %s on line %d
4848
bool(false)
49-
get_class() expects argument #1 ($object) to be of type object, string given
49+
get_class(): Argument #1 ($object) must be of type object, string given
5050
string(3) "foo"
5151
string(4) "foo2"
52-
get_class() expects argument #1 ($object) to be of type object, null given
52+
get_class(): Argument #1 ($object) must be of type object, null given
5353
Done

Zend/tests/arrow_functions/006.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ try {
3232
--EXPECTF--
3333
int(2)
3434
int(10)
35-
{closure}() expects argument #1 ($x) to be of type int, string given, called in %s on line %d
35+
{closure}(): Argument #1 ($x) must be of type int, string given, called in %s on line %d
3636
array(3) {
3737
[0]=>
3838
int(20)
@@ -41,4 +41,4 @@ array(3) {
4141
[2]=>
4242
int(30)
4343
}
44-
{closure}() expects argument #2 ($args) to be of type ?int, string given, called in %s on line %d
44+
{closure}(): Argument #2 ($args) must be of type ?int, string given, called in %s on line %d

Zend/tests/bug31720.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ try {
1212
?>
1313
--EXPECTF--
1414
Warning: Undefined variable: nonesuchvar in %s on line %d
15-
array_walk() expects argument #2 ($funcname) to be a valid callback, first array member is not a valid class name or object
15+
array_walk(): Argument #2 ($funcname) must be a valid callback, first array member is not a valid class name or object

Zend/tests/bug39003.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test($obj);
2020
echo "Done\n";
2121
?>
2222
--EXPECTF--
23-
Fatal error: Uncaught TypeError: test() expects argument #1 ($object) to be of type OtherClassName, ClassName given, called in %s on line %d and defined in %s:%d
23+
Fatal error: Uncaught TypeError: test(): Argument #1 ($object) must be of type OtherClassName, ClassName given, called in %s:%d
2424
Stack trace:
2525
#0 %s(%d): test(Object(ClassName))
2626
#1 {main}

Zend/tests/bug42802.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ok
3737
ok
3838
ok
3939

40-
Fatal error: Uncaught TypeError: foo\test5() expects argument #1 ($bar) to be of type bar, foo\bar given, called in %s on line %d and defined in %s:%d
40+
Fatal error: Uncaught TypeError: foo\test5(): Argument #1 ($bar) must be of type bar, foo\bar given, called in %s:%d
4141
Stack trace:
4242
#0 %s(%d): foo\test5(Object(foo\bar))
4343
#1 {main}

Zend/tests/bug43332_1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $foo = new foo;
1212
$foo->bar($foo); // Ok!
1313
$foo->bar(new \stdclass); // Error, ok!
1414
--EXPECTF--
15-
Fatal error: Uncaught TypeError: foobar\foo::bar() expects argument #1 ($a) to be of type foobar\foo, stdClass given, called in %sbug43332_1.php on line 10 and defined in %sbug43332_1.php:5
15+
Fatal error: Uncaught TypeError: foobar\foo::bar(): Argument #1 ($a) must be of type foobar\foo, stdClass given, called in %s:%d
1616
Stack trace:
1717
#0 %s(%d): foobar\foo->bar(Object(stdClass))
1818
#1 {main}

Zend/tests/bug45186.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ string(1) "y"
5454
ok
5555
__callstatic:
5656
string(3) "www"
57-
call_user_func() expects argument #1 ($function) to be a valid callback, cannot access self:: when no class scope is active
57+
call_user_func(): Argument #1 ($function) must be a valid callback, cannot access self:: when no class scope is active

Zend/tests/bug45186_2.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@ string(1) "y"
5252
__call:
5353
string(1) "y"
5454
ok
55-
call_user_func() expects argument #1 ($function) to be a valid callback, class 'bar' does not have a method 'www'
56-
call_user_func() expects argument #1 ($function) to be a valid callback, cannot access self:: when no class scope is active
55+
call_user_func(): Argument #1 ($function) must be a valid callback, class 'bar' does not have a method 'www'
56+
call_user_func(): Argument #1 ($function) must be a valid callback, cannot access self:: when no class scope is active

Zend/tests/bug48770_2.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ $c->func('This should work!');
5858
--EXPECT--
5959
string(27) "A::func2: This should work!"
6060
string(27) "A::func3: This should work!"
61-
call_user_func_array() expects argument #1 ($function) to be a valid callback, cannot access private method A::func22()
62-
call_user_func_array() expects argument #1 ($function) to be a valid callback, class 'A' does not have a method 'inexistent'
61+
call_user_func_array(): Argument #1 ($function) must be a valid callback, cannot access private method A::func22()
62+
call_user_func_array(): Argument #1 ($function) must be a valid callback, class 'A' does not have a method 'inexistent'

0 commit comments

Comments
 (0)