Skip to content

Commit 7710f99

Browse files
committed
Fix generation of arginfo if type is just null
1 parent 7daa8b7 commit 7710f99

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

build/gen_stub.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,10 @@ function(SimpleType $type) {
510510

511511
public function tryToSimpleType(): ?SimpleType {
512512
$withoutNull = $this->getWithoutNull();
513+
/* type has only null */
514+
if (count($withoutNull->types) === 0) {
515+
return $this->types[0];
516+
}
513517
if (count($withoutNull->types) === 1) {
514518
return $withoutNull->types[0];
515519
}

ext/spl/spl_directory_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ ZEND_END_ARG_INFO()
257257
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SplFileObject_hasChildren, 0, 0, IS_FALSE, 0)
258258
ZEND_END_ARG_INFO()
259259

260-
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_SplFileObject_getChildren, 0, 0, MAY_BE_NULL)
260+
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SplFileObject_getChildren, 0, 0, IS_NULL, 1)
261261
ZEND_END_ARG_INFO()
262262

263263
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SplFileObject_seek, 0, 1, IS_VOID, 0)

0 commit comments

Comments
 (0)