Skip to content

Commit 4096327

Browse files
committed
Address code review comments
1 parent 8513051 commit 4096327

9 files changed

+31
-31
lines changed

Zend/zend_closures.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,9 @@ ZEND_API zend_function *zend_get_closure_invoke_method(zend_object *object) /* {
394394
}
395395
/* }}} */
396396

397-
ZEND_API const zend_function *zend_get_closure_method_def(zval *obj) /* {{{ */
397+
ZEND_API const zend_function *zend_get_closure_method_def(zend_object *obj) /* {{{ */
398398
{
399-
zend_closure *closure = (zend_closure *)Z_OBJ_P(obj);
399+
zend_closure *closure = (zend_closure *) obj;
400400
return &closure->func;
401401
}
402402
/* }}} */

ext/reflection/php_reflection.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,7 @@ ZEND_METHOD(ReflectionFunctionAbstract, getClosureScopeClass)
16031603
}
16041604
GET_REFLECTION_OBJECT();
16051605
if (!Z_ISUNDEF(intern->obj)) {
1606-
closure_func = zend_get_closure_method_def(Z_OBJ(&intern->obj));
1606+
closure_func = zend_get_closure_method_def(Z_OBJ_P(&intern->obj));
16071607
if (closure_func && closure_func->common.scope) {
16081608
zend_reflection_class_factory(closure_func->common.scope, return_value);
16091609
}
@@ -3847,7 +3847,7 @@ ZEND_METHOD(ReflectionClass, getStaticPropertyValue)
38473847
zend_string *name;
38483848
zval *prop, *def_value = NULL;
38493849

3850-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|z!", &name, &def_value) == FAILURE) {
3850+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|z", &name, &def_value) == FAILURE) {
38513851
RETURN_THROWS();
38523852
}
38533853

ext/reflection/php_reflection.stub.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function getAttributes(?string $name = null, int $flags = 0): array {}
103103
class ReflectionFunction extends ReflectionFunctionAbstract
104104
{
105105
/** @param Closure|string $name */
106-
public function __construct($name) {}
106+
public function __construct($function) {}
107107

108108
public function __toString(): string {}
109109

@@ -114,10 +114,10 @@ public function __toString(): string {}
114114
public function isDisabled() {}
115115

116116
/** @return mixed */
117-
public function invoke(mixed ...$arguments) {}
117+
public function invoke(mixed ...$args) {}
118118

119119
/** @return mixed */
120-
public function invokeArgs(array $arguments) {}
120+
public function invokeArgs(array $args) {}
121121

122122
/** @return Closure */
123123
public function getClosure() {}
@@ -184,10 +184,10 @@ public function getClosure($object = UNKNOWN) {}
184184
public function getModifiers() {}
185185

186186
/** @return mixed */
187-
public function invoke(?object $object, mixed ...$arguments) {}
187+
public function invoke(?object $object, mixed ...$args) {}
188188

189189
/** @return mixed */
190-
public function invokeArgs(?object $object, array $arguments) {}
190+
public function invokeArgs(?object $object, array $args) {}
191191

192192
/** @return ReflectionClass */
193193
public function getDeclaringClass() {}
@@ -308,13 +308,13 @@ public function getModifiers() {}
308308
public function isInstance(object $object) {}
309309

310310
/** @return object */
311-
public function newInstance(mixed ...$arguments) {}
311+
public function newInstance(mixed ...$args) {}
312312

313313
/** @return object */
314314
public function newInstanceWithoutConstructor() {}
315315

316316
/** @return object */
317-
public function newInstanceArgs(array $arguments = []) {}
317+
public function newInstanceArgs(array $args = []) {}
318318

319319
/** @return ReflectionClass|false */
320320
public function getParentClass() {}
@@ -381,7 +381,7 @@ class ReflectionProperty implements Reflector
381381
/** @alias ReflectionClass::__clone */
382382
final private function __clone() {}
383383

384-
public function __construct(object|string $class, string $name) {}
384+
public function __construct(object|string $class, string $property) {}
385385

386386
public function __toString(): string {}
387387

@@ -392,7 +392,7 @@ public function getName() {}
392392
public function getValue(?object $object = null) {}
393393

394394
/** @return void */
395-
public function setValue($object_or_value, $value = UNKNOWN) {}
395+
public function setValue($objectOrValue, $value = UNKNOWN) {}
396396

397397
/** @return bool */
398398
public function isInitialized(?object $object = null) {}
@@ -446,7 +446,7 @@ class ReflectionClassConstant implements Reflector
446446
/** @alias ReflectionClass::__clone */
447447
final private function __clone() {}
448448

449-
public function __construct(object|string $class, string $constantName) {}
449+
public function __construct(object|string $class, string $constant) {}
450450

451451
public function __toString(): string {}
452452

ext/reflection/php_reflection_arginfo.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 737d4147f85cc28aea2874c6816846110e5a3566 */
2+
* Stub hash: 592deeea5fae91456c70381b76961b9063d6364c */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Reflection_getModifierNames, 0, 0, 1)
55
ZEND_ARG_TYPE_INFO(0, modifiers, IS_LONG, 0)
@@ -64,7 +64,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionFunctionAbstract
6464
ZEND_END_ARG_INFO()
6565

6666
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionFunction___construct, 0, 0, 1)
67-
ZEND_ARG_INFO(0, name)
67+
ZEND_ARG_INFO(0, function)
6868
ZEND_END_ARG_INFO()
6969

7070
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionFunction___toString, 0, 0, IS_STRING, 0)
@@ -73,11 +73,11 @@ ZEND_END_ARG_INFO()
7373
#define arginfo_class_ReflectionFunction_isDisabled arginfo_class_ReflectionFunctionAbstract___clone
7474

7575
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionFunction_invoke, 0, 0, 0)
76-
ZEND_ARG_VARIADIC_TYPE_INFO(0, arguments, IS_MIXED, 0)
76+
ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0)
7777
ZEND_END_ARG_INFO()
7878

7979
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionFunction_invokeArgs, 0, 0, 1)
80-
ZEND_ARG_TYPE_INFO(0, arguments, IS_ARRAY, 0)
80+
ZEND_ARG_TYPE_INFO(0, args, IS_ARRAY, 0)
8181
ZEND_END_ARG_INFO()
8282

8383
#define arginfo_class_ReflectionFunction_getClosure arginfo_class_ReflectionFunctionAbstract___clone
@@ -131,12 +131,12 @@ ZEND_END_ARG_INFO()
131131

132132
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionMethod_invoke, 0, 0, 1)
133133
ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 1)
134-
ZEND_ARG_VARIADIC_TYPE_INFO(0, arguments, IS_MIXED, 0)
134+
ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0)
135135
ZEND_END_ARG_INFO()
136136

137137
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionMethod_invokeArgs, 0, 0, 2)
138138
ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 1)
139-
ZEND_ARG_TYPE_INFO(0, arguments, IS_ARRAY, 0)
139+
ZEND_ARG_TYPE_INFO(0, args, IS_ARRAY, 0)
140140
ZEND_END_ARG_INFO()
141141

142142
#define arginfo_class_ReflectionMethod_getDeclaringClass arginfo_class_ReflectionFunctionAbstract___clone
@@ -234,7 +234,7 @@ ZEND_END_ARG_INFO()
234234
#define arginfo_class_ReflectionClass_newInstanceWithoutConstructor arginfo_class_ReflectionFunctionAbstract___clone
235235

236236
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionClass_newInstanceArgs, 0, 0, 0)
237-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, arguments, IS_ARRAY, 0, "[]")
237+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, args, IS_ARRAY, 0, "[]")
238238
ZEND_END_ARG_INFO()
239239

240240
#define arginfo_class_ReflectionClass_getParentClass arginfo_class_ReflectionFunctionAbstract___clone
@@ -285,7 +285,7 @@ ZEND_END_ARG_INFO()
285285

286286
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionProperty___construct, 0, 0, 2)
287287
ZEND_ARG_TYPE_MASK(0, class, MAY_BE_OBJECT|MAY_BE_STRING, NULL)
288-
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
288+
ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0)
289289
ZEND_END_ARG_INFO()
290290

291291
#define arginfo_class_ReflectionProperty___toString arginfo_class_ReflectionFunction___toString
@@ -297,7 +297,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionProperty_getValue, 0, 0, 0)
297297
ZEND_END_ARG_INFO()
298298

299299
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionProperty_setValue, 0, 0, 1)
300-
ZEND_ARG_INFO(0, object_or_value)
300+
ZEND_ARG_INFO(0, objectOrValue)
301301
ZEND_ARG_INFO(0, value)
302302
ZEND_END_ARG_INFO()
303303

@@ -338,7 +338,7 @@ ZEND_END_ARG_INFO()
338338

339339
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionClassConstant___construct, 0, 0, 2)
340340
ZEND_ARG_TYPE_MASK(0, class, MAY_BE_OBJECT|MAY_BE_STRING, NULL)
341-
ZEND_ARG_TYPE_INFO(0, constantName, IS_STRING, 0)
341+
ZEND_ARG_TYPE_INFO(0, constant, IS_STRING, 0)
342342
ZEND_END_ARG_INFO()
343343

344344
#define arginfo_class_ReflectionClassConstant___toString arginfo_class_ReflectionFunction___toString

ext/reflection/tests/ReflectionClass_newInstanceArgs_002.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var_dump($a);
1616

1717
?>
1818
--EXPECTF--
19-
Fatal error: Uncaught TypeError: ReflectionClass::newInstanceArgs(): Argument #1 ($arguments) must be of type array, string given in %s:%d
19+
Fatal error: Uncaught TypeError: ReflectionClass::newInstanceArgs(): Argument #1 ($args) must be of type array, string given in %s:%d
2020
Stack trace:
2121
#0 %s(%d): ReflectionClass->newInstanceArgs('x')
2222
#1 {main}

ext/reflection/tests/ReflectionClass_toString_001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector, String
261261
Method [ <internal:Reflection> public method newInstance ] {
262262

263263
- Parameters [1] {
264-
Parameter #0 [ <optional> mixed ...$arguments = <default> ]
264+
Parameter #0 [ <optional> mixed ...$args = <default> ]
265265
}
266266
}
267267

@@ -274,7 +274,7 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector, String
274274
Method [ <internal:Reflection> public method newInstanceArgs ] {
275275

276276
- Parameters [1] {
277-
Parameter #0 [ <optional> array $arguments = [] ]
277+
Parameter #0 [ <optional> array $args = [] ]
278278
}
279279
}
280280

ext/reflection/tests/ReflectionFunction_construct.001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ try {
3535

3636
?>
3737
--EXPECT--
38-
Ok - ReflectionFunction::__construct(): Argument #1 ($name) must be of type Closure|string, array given
38+
Ok - ReflectionFunction::__construct(): Argument #1 ($function) must be of type Closure|string, array given
3939
Function nonExistentFunction() does not exist
4040
Ok - ReflectionFunction::__construct() expects exactly 1 parameter, 0 given
4141
Ok - ReflectionFunction::__construct() expects exactly 1 parameter, 2 given
42-
Ok - ReflectionFunction::__construct(): Argument #1 ($name) must be of type Closure|string, array given
42+
Ok - ReflectionFunction::__construct(): Argument #1 ($function) must be of type Closure|string, array given

ext/reflection/tests/ReflectionMethod_basic2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ string(%d) "Method [ <internal:Reflection, ctor> public method __construct ] {
116116

117117
- Parameters [2] {
118118
Parameter #0 [ <required> object|string $class ]
119-
Parameter #1 [ <required> string $name ]
119+
Parameter #1 [ <required> string $property ]
120120
}
121121
}
122122
"

ext/reflection/tests/ReflectionMethod_invokeArgs_error2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ try {
2424

2525
?>
2626
--EXPECT--
27-
string(90) "ReflectionMethod::invokeArgs(): Argument #2 ($arguments) must be of type array, bool given"
27+
string(85) "ReflectionMethod::invokeArgs(): Argument #2 ($args) must be of type array, bool given"

0 commit comments

Comments
 (0)