Skip to content

Commit e218ca2

Browse files
authored
Improve error message in Phar::buildFromIterator() (#14145)
1 parent d2a9edf commit e218ca2

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

ext/phar/phar_object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */
15001500
}
15011501
ZEND_FALLTHROUGH;
15021502
default:
1503-
zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an invalid value (must return a string)", ZSTR_VAL(ce->name));
1503+
zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an invalid value (must return a string, a stream, or an SplFileInfo object)", ZSTR_VAL(ce->name));
15041504
return ZEND_HASH_APPLY_STOP;
15051505
}
15061506

ext/phar/tests/phar_buildfromiterator5.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ rewind
4949
valid
5050
current
5151
%s(24) "UnexpectedValueException"
52-
Iterator myIterator returned an invalid value (must return a string)
52+
Iterator myIterator returned an invalid value (must return a string, a stream, or an SplFileInfo object)

ext/phar/tests/tar/phar_buildfromiterator5.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ rewind
4949
valid
5050
current
5151
%s(24) "UnexpectedValueException"
52-
Iterator myIterator returned an invalid value (must return a string)
52+
Iterator myIterator returned an invalid value (must return a string, a stream, or an SplFileInfo object)

ext/phar/tests/zip/phar_buildfromiterator5.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ rewind
4949
valid
5050
current
5151
%s(24) "UnexpectedValueException"
52-
Iterator myIterator returned an invalid value (must return a string)
52+
Iterator myIterator returned an invalid value (must return a string, a stream, or an SplFileInfo object)

0 commit comments

Comments
 (0)