Skip to content

Improve error message in Phar::buildFromIterator() #14145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/phar/phar_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */
}
ZEND_FALLTHROUGH;
default:
zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an invalid value (must return a string)", ZSTR_VAL(ce->name));
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));
return ZEND_HASH_APPLY_STOP;
}

Expand Down
2 changes: 1 addition & 1 deletion ext/phar/tests/phar_buildfromiterator5.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ rewind
valid
current
%s(24) "UnexpectedValueException"
Iterator myIterator returned an invalid value (must return a string)
Iterator myIterator returned an invalid value (must return a string, a stream, or an SplFileInfo object)
2 changes: 1 addition & 1 deletion ext/phar/tests/tar/phar_buildfromiterator5.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ rewind
valid
current
%s(24) "UnexpectedValueException"
Iterator myIterator returned an invalid value (must return a string)
Iterator myIterator returned an invalid value (must return a string, a stream, or an SplFileInfo object)
2 changes: 1 addition & 1 deletion ext/phar/tests/zip/phar_buildfromiterator5.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ rewind
valid
current
%s(24) "UnexpectedValueException"
Iterator myIterator returned an invalid value (must return a string)
Iterator myIterator returned an invalid value (must return a string, a stream, or an SplFileInfo object)