Skip to content

Commit 6ba24e9

Browse files
committed
Improve a few parameter names in ext/spl
Use the same names which are used by zend functions.
1 parent 156c180 commit 6ba24e9

5 files changed

+62
-62
lines changed

ext/spl/php_spl.stub.php

+10-7
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22

33
/** @generate-function-entries */
44

5-
function class_implements($what, bool $autoload = true): array|false {}
5+
/** @param object|string $object_or_class */
6+
function class_implements($object_or_class, bool $autoload = true): array|false {}
67

7-
function class_parents($instance, bool $autoload = true): array|false {}
8+
/** @param object|string $object_or_class */
9+
function class_parents($object_or_class, bool $autoload = true): array|false {}
810

9-
function class_uses($what, bool $autoload = true): array|false {}
11+
/** @param object|string $object_or_class */
12+
function class_uses($object_or_class, bool $autoload = true): array|false {}
1013

11-
function spl_autoload(string $class_name, ?string $file_extensions = null): void {}
14+
function spl_autoload(string $class, ?string $file_extensions = null): void {}
1215

13-
function spl_autoload_call(string $class_name): void {}
16+
function spl_autoload_call(string $class): void {}
1417

1518
function spl_autoload_extensions(?string $file_extensions = null): string {}
1619

@@ -22,9 +25,9 @@ function spl_autoload_unregister(callable $autoload_function): bool {}
2225

2326
function spl_classes(): array {}
2427

25-
function spl_object_hash(object $obj): string {}
28+
function spl_object_hash(object $object): string {}
2629

27-
function spl_object_id(object $obj): int {}
30+
function spl_object_id(object $object): int {}
2831

2932
function iterator_apply(Traversable $iterator, callable $function, ?array $args = null): int {}
3033

ext/spl/php_spl_arginfo.h

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: cc1dc8de91f503a88cc7bc47ad239957c2de8303 */
2+
* Stub hash: 31d99979ea43e3d0d2592495977465976ca67760 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_implements, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
5-
ZEND_ARG_INFO(0, what)
5+
ZEND_ARG_INFO(0, object_or_class)
66
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, autoload, _IS_BOOL, 0, "true")
77
ZEND_END_ARG_INFO()
88

9-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_parents, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
10-
ZEND_ARG_INFO(0, instance)
11-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, autoload, _IS_BOOL, 0, "true")
12-
ZEND_END_ARG_INFO()
9+
#define arginfo_class_parents arginfo_class_implements
1310

1411
#define arginfo_class_uses arginfo_class_implements
1512

1613
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_autoload, 0, 1, IS_VOID, 0)
17-
ZEND_ARG_TYPE_INFO(0, class_name, IS_STRING, 0)
14+
ZEND_ARG_TYPE_INFO(0, class, IS_STRING, 0)
1815
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, file_extensions, IS_STRING, 1, "null")
1916
ZEND_END_ARG_INFO()
2017

2118
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_autoload_call, 0, 1, IS_VOID, 0)
22-
ZEND_ARG_TYPE_INFO(0, class_name, IS_STRING, 0)
19+
ZEND_ARG_TYPE_INFO(0, class, IS_STRING, 0)
2320
ZEND_END_ARG_INFO()
2421

2522
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_autoload_extensions, 0, 0, IS_STRING, 0)
@@ -42,11 +39,11 @@ ZEND_END_ARG_INFO()
4239
#define arginfo_spl_classes arginfo_spl_autoload_functions
4340

4441
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_object_hash, 0, 1, IS_STRING, 0)
45-
ZEND_ARG_TYPE_INFO(0, obj, IS_OBJECT, 0)
42+
ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0)
4643
ZEND_END_ARG_INFO()
4744

4845
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_object_id, 0, 1, IS_LONG, 0)
49-
ZEND_ARG_TYPE_INFO(0, obj, IS_OBJECT, 0)
46+
ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0)
5047
ZEND_END_ARG_INFO()
5148

5249
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_iterator_apply, 0, 2, IS_LONG, 0)

ext/spl/tests/bug79432.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ try {
1111

1212
?>
1313
--EXPECT--
14-
spl_autoload_call(): Argument #1 ($class_name) must be of type string, array given
14+
spl_autoload_call(): Argument #1 ($class) must be of type string, array given

ext/spl/tests/class_implements_variation1.phpt

+22-22
Original file line numberDiff line numberDiff line change
@@ -113,61 +113,61 @@ fclose($res);
113113
*** Testing class_implements() : variation ***
114114

115115
--int 0--
116-
class_implements(): Argument #1 ($what) must be of type object|string, int given
116+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, int given
117117

118118
--int 1--
119-
class_implements(): Argument #1 ($what) must be of type object|string, int given
119+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, int given
120120

121121
--int 12345--
122-
class_implements(): Argument #1 ($what) must be of type object|string, int given
122+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, int given
123123

124124
--int -12345--
125-
class_implements(): Argument #1 ($what) must be of type object|string, int given
125+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, int given
126126

127127
--float 10.5--
128-
class_implements(): Argument #1 ($what) must be of type object|string, float given
128+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, float given
129129

130130
--float -10.5--
131-
class_implements(): Argument #1 ($what) must be of type object|string, float given
131+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, float given
132132

133133
--float 12.3456789000e10--
134-
class_implements(): Argument #1 ($what) must be of type object|string, float given
134+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, float given
135135

136136
--float -12.3456789000e10--
137-
class_implements(): Argument #1 ($what) must be of type object|string, float given
137+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, float given
138138

139139
--float .5--
140-
class_implements(): Argument #1 ($what) must be of type object|string, float given
140+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, float given
141141

142142
--empty array--
143-
class_implements(): Argument #1 ($what) must be of type object|string, array given
143+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, array given
144144

145145
--int indexed array--
146-
class_implements(): Argument #1 ($what) must be of type object|string, array given
146+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, array given
147147

148148
--associative array--
149-
class_implements(): Argument #1 ($what) must be of type object|string, array given
149+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, array given
150150

151151
--nested arrays--
152-
class_implements(): Argument #1 ($what) must be of type object|string, array given
152+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, array given
153153

154154
--uppercase NULL--
155-
class_implements(): Argument #1 ($what) must be of type object|string, null given
155+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, null given
156156

157157
--lowercase null--
158-
class_implements(): Argument #1 ($what) must be of type object|string, null given
158+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, null given
159159

160160
--lowercase true--
161-
class_implements(): Argument #1 ($what) must be of type object|string, bool given
161+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, bool given
162162

163163
--lowercase false--
164-
class_implements(): Argument #1 ($what) must be of type object|string, bool given
164+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, bool given
165165

166166
--uppercase TRUE--
167-
class_implements(): Argument #1 ($what) must be of type object|string, bool given
167+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, bool given
168168

169169
--uppercase FALSE--
170-
class_implements(): Argument #1 ($what) must be of type object|string, bool given
170+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, bool given
171171

172172
--empty string DQ--
173173
Error: 2 - class_implements(): Class does not exist and could not be loaded, %s(%d)
@@ -188,10 +188,10 @@ array(0) {
188188
}
189189

190190
--undefined var--
191-
class_implements(): Argument #1 ($what) must be of type object|string, null given
191+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, null given
192192

193193
--unset var--
194-
class_implements(): Argument #1 ($what) must be of type object|string, null given
194+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, null given
195195

196196
--resource--
197-
class_implements(): Argument #1 ($what) must be of type object|string, resource given
197+
class_implements(): Argument #1 ($object_or_class) must be of type object|string, resource given

ext/spl/tests/class_uses_variation1.phpt

+22-22
Original file line numberDiff line numberDiff line change
@@ -113,61 +113,61 @@ fclose($res);
113113
*** Testing class_uses() : variation ***
114114

115115
--int 0--
116-
class_uses(): Argument #1 ($what) must be of type object|string, int given
116+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, int given
117117

118118
--int 1--
119-
class_uses(): Argument #1 ($what) must be of type object|string, int given
119+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, int given
120120

121121
--int 12345--
122-
class_uses(): Argument #1 ($what) must be of type object|string, int given
122+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, int given
123123

124124
--int -12345--
125-
class_uses(): Argument #1 ($what) must be of type object|string, int given
125+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, int given
126126

127127
--float 10.5--
128-
class_uses(): Argument #1 ($what) must be of type object|string, float given
128+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, float given
129129

130130
--float -10.5--
131-
class_uses(): Argument #1 ($what) must be of type object|string, float given
131+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, float given
132132

133133
--float 12.3456789000e10--
134-
class_uses(): Argument #1 ($what) must be of type object|string, float given
134+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, float given
135135

136136
--float -12.3456789000e10--
137-
class_uses(): Argument #1 ($what) must be of type object|string, float given
137+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, float given
138138

139139
--float .5--
140-
class_uses(): Argument #1 ($what) must be of type object|string, float given
140+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, float given
141141

142142
--empty array--
143-
class_uses(): Argument #1 ($what) must be of type object|string, array given
143+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, array given
144144

145145
--int indexed array--
146-
class_uses(): Argument #1 ($what) must be of type object|string, array given
146+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, array given
147147

148148
--associative array--
149-
class_uses(): Argument #1 ($what) must be of type object|string, array given
149+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, array given
150150

151151
--nested arrays--
152-
class_uses(): Argument #1 ($what) must be of type object|string, array given
152+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, array given
153153

154154
--uppercase NULL--
155-
class_uses(): Argument #1 ($what) must be of type object|string, null given
155+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, null given
156156

157157
--lowercase null--
158-
class_uses(): Argument #1 ($what) must be of type object|string, null given
158+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, null given
159159

160160
--lowercase true--
161-
class_uses(): Argument #1 ($what) must be of type object|string, bool given
161+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, bool given
162162

163163
--lowercase false--
164-
class_uses(): Argument #1 ($what) must be of type object|string, bool given
164+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, bool given
165165

166166
--uppercase TRUE--
167-
class_uses(): Argument #1 ($what) must be of type object|string, bool given
167+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, bool given
168168

169169
--uppercase FALSE--
170-
class_uses(): Argument #1 ($what) must be of type object|string, bool given
170+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, bool given
171171

172172
--empty string DQ--
173173
Error: 2 - class_uses(): Class does not exist and could not be loaded, %s(%d)
@@ -186,10 +186,10 @@ array(0) {
186186
}
187187

188188
--undefined var--
189-
class_uses(): Argument #1 ($what) must be of type object|string, null given
189+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, null given
190190

191191
--unset var--
192-
class_uses(): Argument #1 ($what) must be of type object|string, null given
192+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, null given
193193

194194
--resource--
195-
class_uses(): Argument #1 ($what) must be of type object|string, resource given
195+
class_uses(): Argument #1 ($object_or_class) must be of type object|string, resource given

0 commit comments

Comments
 (0)