Skip to content

Commit 95ad1d1

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: Make DirectoryIterator current() / key() return types tentative
2 parents 0db03c4 + d0a0518 commit 95ad1d1

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

ext/spl/spl_directory.stub.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,16 @@ public function rewind(): void {}
123123
/** @tentative-return-type */
124124
public function valid(): bool {}
125125

126-
/** @return int */
126+
/**
127+
* @tentative-return-type
128+
* @return int
129+
*/
127130
public function key(): mixed {} // TODO change return type to string
128131

129-
/** @return DirectoryIterator */
132+
/**
133+
* @tentative-return-type
134+
* @return DirectoryIterator
135+
*/
130136
public function current(): mixed {} // TODO narrow return type
131137

132138
/** @tentative-return-type */

ext/spl/spl_directory_arginfo.h

Lines changed: 2 additions & 2 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: eab71d8a7172dba2dac3c6fa97b2064c7a99191f */
2+
* Stub hash: 3f2caf1c46760d8ef629ccb2e94ab0dba09f713b */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileInfo___construct, 0, 0, 1)
55
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
@@ -102,7 +102,7 @@ ZEND_END_ARG_INFO()
102102

103103
#define arginfo_class_DirectoryIterator_valid arginfo_class_SplFileInfo_isWritable
104104

105-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_DirectoryIterator_key, 0, 0, IS_MIXED, 0)
105+
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DirectoryIterator_key, 0, 0, IS_MIXED, 0)
106106
ZEND_END_ARG_INFO()
107107

108108
#define arginfo_class_DirectoryIterator_current arginfo_class_DirectoryIterator_key

0 commit comments

Comments
 (0)