Fix Phar::offsetGet() return type

It's possible to change the returned type using setFileClass(),
which unfortunately only enforces that it's a subtype of
SplFileInfo, not PharFileInfo.
This commit is contained in:
Nikita Popov 2021-07-13 12:02:05 +02:00
parent ee65e92070
commit 3fc3cfbad0
2 changed files with 4 additions and 4 deletions

View file

@ -106,7 +106,7 @@ class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess
* @param string $localName
* @tentative-return-type
*/
public function offsetGet($localName): PharFileInfo {}
public function offsetGet($localName): SplFileInfo {}
/**
* @param string $localName
@ -371,7 +371,7 @@ class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAcc
* @tentative-return-type
* @implementation-alias Phar::offsetGet
*/
public function offsetGet($localName): PharFileInfo {}
public function offsetGet($localName): SplFileInfo {}
/**
* @param string $localName

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: fa11774e0b29ff4f711f1677b395545334e1aee9 */
* Stub hash: ac04a4161a11d054922cb04787f81f5661203e3e */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar___construct, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
@ -119,7 +119,7 @@ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Phar_offsetExist
ZEND_ARG_INFO(0, localName)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_Phar_offsetGet, 0, 1, PharFileInfo, 0)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_Phar_offsetGet, 0, 1, SplFileInfo, 0)
ZEND_ARG_INFO(0, localName)
ZEND_END_ARG_INFO()