8000 Fix Phar::offsetGet() return type · nikic/php-src@3fc3cfb · GitHub
[go: up one dir, main page]

Skip to content

Commit 3fc3cfb

Browse files
committed
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.
1 parent ee65e92 commit 3fc3cfb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ext/phar/phar_object.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function offsetExists($localName): bool {}
106106
* @param string $localName
107107
* @tentative-return-type
108108
*/
109-
public function offsetGet($localName): PharFileInfo {}
109+
public function offsetGet($localName): SplFileInfo {}
110110

111111
/**
112112
* @param string $localName
@@ -371,7 +371,7 @@ public function offsetExists($localName): bool {}
371371
* @tentative-return-type
372372
* @implementation-alias Phar::offsetGet
373373
*/
374-
public function offsetGet($localName): PharFileInfo {}
374+
public function offsetGet($localName): SplFileInfo {}
375375

376376
/**
377377
* @param string $localName

ext/phar/phar_object_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: fa11774e0b29ff4f711f1677b395545334e1aee9 */
2+
* Stub hash: ac04a4161a11d054922cb04787f81f5661203e3e */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar___construct, 0, 0, 1)
55
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
119119
ZEND_ARG_INFO(0, localName)
120120
ZEND_END_ARG_INFO()
121121

122-
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_Phar_offsetGet, 0, 1, PharFileInfo, 0)
122+
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_Phar_offsetGet, 0, 1, SplFileInfo, 0)
123123
ZEND_ARG_INFO(0, localName)
124124
ZEND_END_ARG_INFO()
125125

0 commit comments

Comments
 (0)
0