]> granicus.if.org Git - php/commit
Always throw TypeException on throwing zpp failures
authorNikita Popov <nikic@php.net>
Thu, 2 Apr 2015 16:52:32 +0000 (18:52 +0200)
committerNikita Popov <nikic@php.net>
Mon, 6 Apr 2015 09:27:34 +0000 (11:27 +0200)
commit122d759618a42bff105971b923fbbb5be02e34b9
treefd4487414ffa3f120c77b19b9eb7dc409659c57e
parent884b0365dbe718f667d048dbc3d1cd9d9f12ab84
Always throw TypeException on throwing zpp failures

Introduces a ZEND_PARSE_PARAMS_THROW flag for zpp, which forces to
report FAILURE errors using a TypeException instead of a Warning,
like it would happen in strict mode.

Adds a zend_parse_parameters_throw() convenience function, which
invokes zpp with this flag.

Converts all cases I could identify, where we currently have
throwing zpp usage in constructors and replaces them with this API.
Error handling is still replaced to EH_THROW in some cases to handle
other, domain-specific errors in constructors.
88 files changed:
Zend/zend.c
Zend/zend.h
Zend/zend_API.c
Zend/zend_API.h
ext/date/php_date.c
ext/date/tests/DateTimeZone_construct_error.phpt
ext/date/tests/DateTimeZone_construct_variation1.phpt
ext/date/tests/DateTime_construct_error.phpt
ext/date/tests/DateTime_construct_variation1.phpt
ext/date/tests/DateTime_construct_variation2.phpt
ext/dom/attr.c
ext/dom/cdatasection.c
ext/dom/comment.c
ext/dom/document.c
ext/dom/documentfragment.c
ext/dom/element.c
ext/dom/entityreference.c
ext/dom/processinginstruction.c
ext/dom/tests/DOMAttr_construct_error_001.phpt
ext/dom/tests/DOMCDATASection_construct_error_001.phpt
ext/dom/tests/DOMComment_construct_error_001.phpt
ext/dom/tests/DOMDocumentFragment_construct_error_001.phpt
ext/dom/text.c
ext/dom/xpath.c
ext/fileinfo/fileinfo.c
ext/fileinfo/tests/bug61173.phpt
ext/fileinfo/tests/finfo_open_error.phpt
ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
ext/intl/calendar/gregoriancalendar_methods.cpp
ext/intl/collator/collator_create.c
ext/intl/converter/converter.c
ext/intl/dateformat/dateformat_create.cpp
ext/intl/formatter/formatter_main.c
ext/intl/intl_error.c
ext/intl/intl_error.h
ext/intl/msgformat/msgformat.c
ext/intl/resourcebundle/resourcebundle_class.c
ext/intl/spoofchecker/spoofchecker_create.c
ext/intl/tests/breakiter___construct_error.phpt
ext/intl/tests/formatter_fail.phpt
ext/intl/tests/gregoriancalendar___construct_error.phpt
ext/intl/tests/msgfmt_fail.phpt
ext/intl/tests/msgfmt_fail2.phpt
ext/pdo/pdo_dbh.c
ext/pdo_mysql/tests/pdo_mysql___construct.phpt
ext/pdo_mysql/tests/pdo_mysql___construct_options.phpt
ext/phar/phar_object.c
ext/phar/tests/badparameters.phpt
ext/phar/tests/bug60261.phpt
ext/phar/tests/pharfileinfo_construct.phpt
ext/reflection/php_reflection.c
ext/reflection/tests/ReflectionExtension_constructor_error.phpt
ext/reflection/tests/ReflectionFunction_construct.001.phpt
ext/reflection/tests/ReflectionMethod_006.phpt
ext/reflection/tests/ReflectionMethod_constructor_error2.phpt
ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt
ext/reflection/tests/ReflectionProperty_error.phpt
ext/simplexml/simplexml.c
ext/snmp/snmp.c
ext/spl/spl_array.c
ext/spl/spl_directory.c
ext/spl/spl_fixedarray.c
ext/spl/spl_iterators.c
ext/spl/spl_observer.c
ext/spl/tests/CallbackFilterIteratorTest-002.phpt
ext/spl/tests/SplFixedArray__construct_param_array.phpt
ext/spl/tests/SplFixedArray__construct_param_string.phpt
ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt
ext/spl/tests/SplTempFileObject_constructor_error.phpt
ext/spl/tests/arrayObject___construct_error1.phpt
ext/spl/tests/arrayObject___construct_error2.phpt
ext/spl/tests/arrayObject_setIteratorClass_error1.phpt
ext/spl/tests/bug54292.phpt
ext/spl/tests/fixedarray_005.phpt
ext/spl/tests/fixedarray_009.phpt
ext/spl/tests/fixedarray_015.phpt
ext/spl/tests/iterator_056.phpt
ext/spl/tests/iterator_059.phpt [deleted file]
ext/spl/tests/iterator_060.phpt [deleted file]
ext/spl/tests/iterator_061.phpt [deleted file]
ext/spl/tests/iterator_063.phpt [deleted file]
ext/spl/tests/iterator_064.phpt [deleted file]
ext/spl/tests/iterator_065.phpt [deleted file]
ext/spl/tests/iterator_066.phpt [deleted file]
ext/spl/tests/recursive_tree_iterator_003.phpt
ext/spl/tests/spl_iterator_iterator_constructor.phpt
ext/sqlite3/sqlite3.c
ext/sqlite3/tests/sqlite3_02_open.phpt