Skip to content

Commit 5759fbf

Browse files
committed
Add parameter union type declarations that include a class
1 parent f42c333 commit 5759fbf

File tree

3 files changed

+11
-18
lines changed

3 files changed

+11
-18
lines changed

ext/reflection/php_reflection.stub.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ public function getAttributes(?string $name = null, int $flags = 0): array {}
102102

103103
class ReflectionFunction extends ReflectionFunctionAbstract
104104
{
105-
/** @param Closure|string $name */
106-
public function __construct($function) {}
105+
public function __construct(Closure|string $function) {}
107106

108107
public function __toString(): string {}
109108

@@ -319,11 +318,8 @@ public function newInstanceArgs(array $args = []) {}
319318
/** @return ReflectionClass|false */
320319
public function getParentClass() {}
321320

322-
/**
323-
* @param ReflectionClass|string $class
324-
* @return bool
325-
*/
326-
public function isSubclassOf($class) {}
321+
/** @return bool */
322+
public function isSubclassOf(ReflectionClass|string $class) {}
327323

328324
/** @return array|null */
329325
public function getStaticProperties() {}
@@ -346,11 +342,8 @@ public function isIterable() {}
346342
*/
347343
public function isIterateable() {}
348344

349-
/**
350-
* @param ReflectionClass|string $interface
351-
* @return bool
352-
*/
353-
public function implementsInterface($interface) {}
345+
/** @return bool */
346+
public function implementsInterface(ReflectionClass|string $interface) {}
354347

355348
/** @return ReflectionExtension|null */
356349
public function getExtension() {}

ext/reflection/php_reflection_arginfo.h

Lines changed: 4 additions & 4 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: 592deeea5fae91456c70381b76961b9063d6364c */
2+
* Stub hash: 0a3d9fb707ddf5e508075799bf06ff42b849a4b8 */
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, function)
67+
ZEND_ARG_OBJ_TYPE_MASK(0, function, Closure, MAY_BE_STRING, NULL)
6868
ZEND_END_ARG_INFO()
6969

7070
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionFunction___toString, 0, 0, IS_STRING, 0)
@@ -240,7 +240,7 @@ ZEND_END_ARG_INFO()
240240
#define arginfo_class_ReflectionClass_getParentClass arginfo_class_ReflectionFunctionAbstract___clone
241241

242242
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionClass_isSubclassOf, 0, 0, 1)
243-
ZEND_ARG_INFO(0, class)
243+
ZEND_ARG_OBJ_TYPE_MASK(0, class, ReflectionClass, MAY_BE_STRING, NULL)
244244
ZEND_END_ARG_INFO()
245245

246246
#define arginfo_class_ReflectionClass_getStaticProperties arginfo_class_ReflectionFunctionAbstract___clone
@@ -262,7 +262,7 @@ ZEND_END_ARG_INFO()
262262
#define arginfo_class_ReflectionClass_isIterateable arginfo_class_ReflectionFunctionAbstract___clone
263263

264264
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionClass_implementsInterface, 0, 0, 1)
265-
ZEND_ARG_INFO(0, interface)
265+
ZEND_ARG_OBJ_TYPE_MASK(0, interface, ReflectionClass, MAY_BE_STRING, NULL)
266266
ZEND_END_ARG_INFO()
267267

268268
#define arginfo_class_ReflectionClass_getExtension arginfo_class_ReflectionFunctionAbstract___clone

ext/reflection/tests/ReflectionClass_toString_001.phpt

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

289289
- Parameters [1] {
290-
Parameter #0 [ <required> $class ]
290+
Parameter #0 [ <required> ReflectionClass|string $class ]
291291
}
292292
}
293293

@@ -334,7 +334,7 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector, String
334334
Method [ <internal:Reflection> public method implementsInterface ] {
335335

336336
- Parameters [1] {
337-
Parameter #0 [ <required> $interface ]
337+
Parameter #0 [ <required> ReflectionClass|string $interface ]
338338
}
339339
}
340340

0 commit comments

Comments
 (0)