From 1050956ad1c995412db1e11f34ec97bf0a2c83e7 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Mon, 6 Mar 2006 09:47:03 +0000 Subject: [PATCH] - Proto fixes --- ext/reflection/php_reflection.c | 14 +++--- ext/spl/spl_directory.c | 4 +- ext/spl/spl_iterators.c | 82 ++++++++++++++++----------------- ext/spl/spl_sxe.c | 32 +++++++++---- 4 files changed, 72 insertions(+), 60 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index b892a8152c..2f2c4b8d8f 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1338,7 +1338,7 @@ ZEND_METHOD(reflection_function, export) } /* }}} */ -/* {{{ proto public ReflectionFunction::__construct(string name) +/* {{{ proto public void ReflectionFunction::__construct(string name) Constructor. Throws an Exception in case the given function does not exist */ ZEND_METHOD(reflection_function, __construct) { @@ -1755,7 +1755,7 @@ ZEND_METHOD(reflection_parameter, export) } /* }}} */ -/* {{{ proto public ReflectionParameter::__construct(mixed function, mixed parameter) +/* {{{ proto public void ReflectionParameter::__construct(mixed function, mixed parameter) Constructor. Throws an Exception in case the given method does not exist */ ZEND_METHOD(reflection_parameter, __construct) { @@ -2059,7 +2059,7 @@ ZEND_METHOD(reflection_method, export) } /* }}} */ -/* {{{ proto public ReflectionMethod::__construct(mixed class_or_method [, string name]) +/* {{{ proto public void ReflectionMethod::__construct(mixed class_or_method [, string name]) Constructor. Throws an Exception in case the given method does not exist */ ZEND_METHOD(reflection_method, __construct) { @@ -2570,7 +2570,7 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob } /* }}} */ -/* {{{ proto public ReflectionClass::__construct(mixed argument) throws ReflectionException +/* {{{ proto public void ReflectionClass::__construct(mixed argument) throws ReflectionException Constructor. Takes a string or an instance as an argument */ ZEND_METHOD(reflection_class, __construct) { @@ -3572,7 +3572,7 @@ ZEND_METHOD(reflection_object, export) } /* }}} */ -/* {{{ proto public ReflectionObject::__construct(mixed argument) throws ReflectionException +/* {{{ proto public void ReflectionObject::__construct(mixed argument) throws ReflectionException Constructor. Takes an instance as an argument */ ZEND_METHOD(reflection_object, __construct) { @@ -3588,7 +3588,7 @@ ZEND_METHOD(reflection_property, export) } /* }}} */ -/* {{{ proto public ReflectionProperty::__construct(mixed class, string name) +/* {{{ proto public void ReflectionProperty::__construct(mixed class, string name) Constructor. Throws an Exception in case the given property does not exist */ ZEND_METHOD(reflection_property, __construct) { @@ -3941,7 +3941,7 @@ ZEND_METHOD(reflection_extension, export) } /* }}} */ -/* {{{ proto public ReflectionExtension::__construct(string name) +/* {{{ proto public void ReflectionExtension::__construct(string name) Constructor. Throws an Exception in case the given extension does not exist */ ZEND_METHOD(reflection_extension, __construct) { diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 1f4f589133..2b5c7da5d0 100755 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -741,7 +741,7 @@ SPL_METHOD(SplFileInfo, openFile) } /* }}} */ -/* {{{ proto SplFileObject SplFileInfo::setFileClass([string class_name]) +/* {{{ proto void SplFileInfo::setFileClass([string class_name]) Class to use in openFile() */ SPL_METHOD(SplFileInfo, setFileClass) { @@ -758,7 +758,7 @@ SPL_METHOD(SplFileInfo, setFileClass) } /* }}} */ -/* {{{ proto SplFileObject SplFileInfo::setInfoClass([string class_name]) +/* {{{ proto void SplFileInfo::setInfoClass([string class_name]) Class to use in getFileInfo(), getPathInfo() */ SPL_METHOD(SplFileInfo, setInfoClass) { diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index cbf8af63f7..cc4e3f95d9 100755 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -367,7 +367,7 @@ zend_object_iterator_funcs spl_recursive_it_iterator_funcs = { spl_recursive_it_rewind }; -/* {{{ proto RecursiveIteratorIterator::__construct(RecursiveIterator|IteratorAggregate it [, int mode = RIT_LEAVES_ONLY [, int flags = 0]]) throws InvalidArgumentException +/* {{{ proto void RecursiveIteratorIterator::__construct(RecursiveIterator|IteratorAggregate it [, int mode = RIT_LEAVES_ONLY [, int flags = 0]]) throws InvalidArgumentException Creates a RecursiveIteratorIterator from a RecursiveIterator. */ SPL_METHOD(RecursiveIteratorIterator, __construct) { @@ -456,7 +456,7 @@ SPL_METHOD(RecursiveIteratorIterator, rewind) spl_recursive_it_rewind_ex(object, getThis() TSRMLS_CC); } /* }}} */ -/* {{{ proto bolean RecursiveIteratorIterator::valid() +/* {{{ proto bool RecursiveIteratorIterator::valid() Check whether the current position is valid */ SPL_METHOD(RecursiveIteratorIterator, valid) { @@ -601,28 +601,28 @@ SPL_METHOD(RecursiveIteratorIterator, callGetChildren) } } /* }}} */ -/* {{{ proto RecursiveIterator RecursiveIteratorIterator::beginChildren() +/* {{{ proto void RecursiveIteratorIterator::beginChildren() Called when recursing one level down */ SPL_METHOD(RecursiveIteratorIterator, beginChildren) { /* nothing to do */ } /* }}} */ -/* {{{ proto RecursiveIterator RecursiveIteratorIterator::endChildren() +/* {{{ proto void RecursiveIteratorIterator::endChildren() Called when end recursing one level */ SPL_METHOD(RecursiveIteratorIterator, endChildren) { /* nothing to do */ } /* }}} */ -/* {{{ proto RecursiveIterator RecursiveIteratorIterator::nextElement() +/* {{{ proto void RecursiveIteratorIterator::nextElement() Called when the next element is available */ SPL_METHOD(RecursiveIteratorIterator, nextElement) { /* nothing to do */ } /* }}} */ -/* {{{ proto RecursiveIterator RecursiveIteratorIterator::setMaxDepth([$max_depth = -1]) +/* {{{ proto void RecursiveIteratorIterator::setMaxDepth([$max_depth = -1]) Set the maximum allowed depth (or any depth if pmax_depth = -1] */ SPL_METHOD(RecursiveIteratorIterator, setMaxDepth) { @@ -639,7 +639,7 @@ SPL_METHOD(RecursiveIteratorIterator, setMaxDepth) object->max_depth = max_depth; } /* }}} */ -/* {{{ proto RecursiveIterator RecursiveIteratorIterator::getMaxDepth() +/* {{{ proto int|false RecursiveIteratorIterator::getMaxDepth() Return the maximum accepted depth or false if any depth is allowed */ SPL_METHOD(RecursiveIteratorIterator, getMaxDepth) { @@ -979,7 +979,7 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z return intern; } -/* {{{ proto FilterIterator::__construct(Iterator it) +/* {{{ proto void FilterIterator::__construct(Iterator it) Create an Iterator from another iterator */ SPL_METHOD(FilterIterator, __construct) { @@ -1095,10 +1095,10 @@ SPL_METHOD(dual_it, rewind) spl_dual_it_fetch(intern, 1 TSRMLS_CC); } /* }}} */ -/* {{{ proto boolean FilterIterator::valid() - proto boolean ParentIterator::valid() - proto boolean IteratorIterator::valid() - proto boolean NoRewindIterator::valid() +/* {{{ proto bool FilterIterator::valid() + proto bool ParentIterator::valid() + proto bool IteratorIterator::valid() + proto bool NoRewindIterator::valid() Check whether the current element is valid */ SPL_METHOD(dual_it, valid) { @@ -1221,14 +1221,14 @@ SPL_METHOD(FilterIterator, next) spl_filter_it_next(getThis(), intern TSRMLS_CC); } /* }}} */ -/* {{{ proto RecursiveFilterIterator::__construct(RecursiveIterator it) +/* {{{ proto void RecursiveFilterIterator::__construct(RecursiveIterator it) Create a RecursiveFilterIterator from a RecursiveIterator */ SPL_METHOD(RecursiveFilterIterator, __construct) { spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, spl_ce_RecursiveFilterIterator, spl_ce_RecursiveIterator, DIT_RecursiveFilterIterator); } /* }}} */ -/* {{{ proto boolean RecursiveFilterIterator::hasChildren() +/* {{{ proto bool RecursiveFilterIterator::hasChildren() Check whether the inner iterator's current element has children */ SPL_METHOD(RecursiveFilterIterator, hasChildren) { @@ -1255,14 +1255,14 @@ SPL_METHOD(RecursiveFilterIterator, getChildren) zval_ptr_dtor(&retval); } /* }}} */ -/* {{{ proto ParentIterator::__construct(RecursiveIterator it) +/* {{{ proto void ParentIterator::__construct(RecursiveIterator it) Create a ParentIterator from a RecursiveIterator */ SPL_METHOD(ParentIterator, __construct) { spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, spl_ce_ParentIterator, spl_ce_RecursiveIterator, DIT_ParentIterator); } /* }}} */ -/* {{{ proto boolean ParentIterator::hasChildren() +/* {{{ proto bool ParentIterator::hasChildren() Check whether the inner iterator's current element has children */ SPL_METHOD(ParentIterator, hasChildren) { @@ -1290,7 +1290,7 @@ SPL_METHOD(ParentIterator, getChildren) } /* }}} */ #if HAVE_PCRE || HAVE_BUNDLED_PCRE -/* {{{ proto RegExIterator::__construct(Iterator it, string $regex [, int $flags]) +/* {{{ proto void RegExIterator::__construct(Iterator it, string $regex [, int $flags]) Create an RegExIterator from another iterator and a regular expression */ SPL_METHOD(RegExIterator, __construct) { @@ -1340,7 +1340,7 @@ SPL_METHOD(RegExIterator, accept) RETURN_BOOL(count >= 0); } /* }}} */ -/* {{{ proto RecursiveRegExIterator::__construct(RecursiveIterator it, string $regex [, int $flags]) +/* {{{ proto void RecursiveRegExIterator::__construct(RecursiveIterator it, string $regex [, int $flags]) Create an RecursiveRegExIterator from another recursive iterator and a regular expression */ SPL_METHOD(RecursiveRegExIterator, __construct) { @@ -1540,7 +1540,7 @@ SPL_METHOD(LimitIterator, rewind) spl_limit_it_seek(intern, intern->u.limit.offset TSRMLS_CC); } /* }}} */ -/* {{{ proto boolean LimitIterator::valid() +/* {{{ proto bool LimitIterator::valid() Check whether the current element is valid */ SPL_METHOD(LimitIterator, valid) { @@ -1705,7 +1705,7 @@ static inline void spl_caching_it_rewind(spl_dual_it_object *intern TSRMLS_DC) spl_caching_it_next(intern TSRMLS_CC); } -/* {{{ proto CachingIterator::__construct(Iterator it [, flags = CIT_CALL_TOSTRING]) +/* {{{ proto void CachingIterator::__construct(Iterator it [, flags = CIT_CALL_TOSTRING]) Construct a CachingIterator from an Iterator */ SPL_METHOD(CachingIterator, __construct) { @@ -1723,7 +1723,7 @@ SPL_METHOD(CachingIterator, rewind) spl_caching_it_rewind(intern TSRMLS_CC); } /* }}} */ -/* {{{ proto boolean CachingIterator::valid() +/* {{{ proto bool CachingIterator::valid() Check whether the current element is valid */ SPL_METHOD(CachingIterator, valid) { @@ -1745,7 +1745,7 @@ SPL_METHOD(CachingIterator, next) spl_caching_it_next(intern TSRMLS_CC); } /* }}} */ -/* {{{ proto boolean CachingIterator::hasNext() +/* {{{ proto bool CachingIterator::hasNext() Check whether the inner iterator has a valid next element */ SPL_METHOD(CachingIterator, hasNext) { @@ -1975,14 +1975,14 @@ static zend_function_entry spl_funcs_CachingIterator[] = { {NULL, NULL, NULL} }; -/* {{{ proto RecursiveCachingIterator::__construct(RecursiveIterator it [, flags = CIT_CALL_TOSTRING]) +/* {{{ proto void RecursiveCachingIterator::__construct(RecursiveIterator it [, flags = CIT_CALL_TOSTRING]) Create an iterator from a RecursiveIterator */ SPL_METHOD(RecursiveCachingIterator, __construct) { spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, spl_ce_RecursiveCachingIterator, spl_ce_RecursiveIterator, DIT_RecursiveCachingIterator); } /* }}} */ -/* {{{ proto bolean RecursiveCachingIterator::hasChildren() +/* {{{ proto bool RecursiveCachingIterator::hasChildren() Check whether the current element of the inner iterator has children */ SPL_METHOD(RecursiveCachingIterator, hasChildren) { @@ -2021,7 +2021,7 @@ static zend_function_entry spl_funcs_RecursiveCachingIterator[] = { {NULL, NULL, NULL} }; -/* {{{ proto IteratorIterator::__construct(Traversable it) +/* {{{ proto void IteratorIterator::__construct(Traversable it) Create an iterator from anything that is traversable */ SPL_METHOD(IteratorIterator, __construct) { @@ -2044,7 +2044,7 @@ static zend_function_entry spl_funcs_IteratorIterator[] = { {NULL, NULL, NULL} }; -/* {{{ proto NoRewindIterator::__construct(Iterator it) +/* {{{ proto void NoRewindIterator::__construct(Iterator it) Create an iterator from another iterator */ SPL_METHOD(NoRewindIterator, __construct) { @@ -2058,7 +2058,7 @@ SPL_METHOD(NoRewindIterator, rewind) /* nothing to do */ } /* }}} */ -/* {{{ proto void NoRewindIterator::valid() +/* {{{ proto bool NoRewindIterator::valid() Return inner iterators valid() */ SPL_METHOD(NoRewindIterator, valid) { @@ -2136,14 +2136,14 @@ static zend_function_entry spl_funcs_NoRewindIterator[] = { {NULL, NULL, NULL} }; -/* {{{ proto InfiniteIterator::__construct(Iterator it) +/* {{{ proto void InfiniteIterator::__construct(Iterator it) Create an iterator from another iterator */ SPL_METHOD(InfiniteIterator, __construct) { spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, spl_ce_InfiniteIterator, zend_ce_iterator, DIT_InfiniteIterator); } /* }}} */ -/* {{{ proto InfiniteIterator::next() +/* {{{ proto void InfiniteIterator::next() Prevent a call to inner iterators rewind() (internally the current data will be fetched if valid()) */ SPL_METHOD(InfiniteIterator, next) { @@ -2168,34 +2168,34 @@ static zend_function_entry spl_funcs_InfiniteIterator[] = { {NULL, NULL, NULL} }; -/* {{{ proto EmptyIterator::rewind() +/* {{{ proto void EmptyIterator::rewind() Does nothing */ SPL_METHOD(EmptyIterator, rewind) { } /* }}} */ -/* {{{ proto EmptyIterator::valid() +/* {{{ proto false EmptyIterator::valid() Return false */ SPL_METHOD(EmptyIterator, valid) { RETURN_FALSE; } /* }}} */ -/* {{{ proto EmptyIterator::key() - Throws exception */ +/* {{{ proto void EmptyIterator::key() + Throws exception BadMethodCallException */ SPL_METHOD(EmptyIterator, key) { zend_throw_exception(spl_ce_BadMethodCallException, "Accessing the key of an EmptyIterator", 0 TSRMLS_CC); } /* }}} */ -/* {{{ proto EmptyIterator::current() - Throws exception */ +/* {{{ proto void EmptyIterator::current() + Throws exception BadMethodCallException */ SPL_METHOD(EmptyIterator, current) { zend_throw_exception(spl_ce_BadMethodCallException, "Accessing the value of an EmptyIterator", 0 TSRMLS_CC); } /* }}} */ -/* {{{ proto EmptyIterator::next() +/* {{{ proto void EmptyIterator::next() Does nothing */ SPL_METHOD(EmptyIterator, next) { @@ -2259,7 +2259,7 @@ void spl_append_it_next(spl_dual_it_object *intern TSRMLS_DC) /* {{{ */ spl_append_it_fetch(intern TSRMLS_CC); } /* }}} */ -/* {{{ proto AppendIterator::__construct() +/* {{{ proto void AppendIterator::__construct() Create an AppendIterator */ SPL_METHOD(AppendIterator, __construct) { @@ -2307,7 +2307,7 @@ SPL_METHOD(AppendIterator, rewind) } } /* }}} */ -/* {{{ proto boolean AppendIterator::valid() +/* {{{ proto bool AppendIterator::valid() Check if the current state is valid */ SPL_METHOD(AppendIterator, valid) { @@ -2318,7 +2318,7 @@ SPL_METHOD(AppendIterator, valid) RETURN_BOOL(intern->current.data); } /* }}} */ -/* {{{ proto AppendIterator::next() +/* {{{ proto void AppendIterator::next() Forward to next element */ SPL_METHOD(AppendIterator, next) { @@ -2329,7 +2329,7 @@ SPL_METHOD(AppendIterator, next) spl_append_it_next(intern TSRMLS_CC); } /* }}} */ -/* {{{ proto AppendIterator::getIteratorIndex() +/* {{{ proto int AppendIterator::getIteratorIndex() Get index of iterator */ SPL_METHOD(AppendIterator, getIteratorIndex) { @@ -2341,7 +2341,7 @@ SPL_METHOD(AppendIterator, getIteratorIndex) spl_array_iterator_key(intern->u.append.zarrayit, return_value TSRMLS_CC); } /* }}} */ -/* {{{ proto AppendIterator::getArrayIterator() +/* {{{ proto ArrayIterator AppendIterator::getArrayIterator() Get access to inner ArrayIterator */ SPL_METHOD(AppendIterator, getArrayIterator) { diff --git a/ext/spl/spl_sxe.c b/ext/spl/spl_sxe.c index a8fbe404c8..6eafd26ef6 100755 --- a/ext/spl/spl_sxe.c +++ b/ext/spl/spl_sxe.c @@ -41,7 +41,9 @@ zend_class_entry *spl_ce_SimpleXMLElement; #include "ext/simplexml/php_simplexml_exports.h" -SPL_METHOD(SimpleXMLIterator, rewind) /* {{{ */ +/* {{{ proto void SimpleXMLIterator::rewind() + Rewind to first element */ +SPL_METHOD(SimpleXMLIterator, rewind) { php_sxe_iterator iter; @@ -50,7 +52,9 @@ SPL_METHOD(SimpleXMLIterator, rewind) /* {{{ */ } /* }}} */ -SPL_METHOD(SimpleXMLIterator, valid) /* {{{ */ +/* {{{ proto bool SimpleXMLIterator::valid() + Check whether iteration is valid */ +SPL_METHOD(SimpleXMLIterator, valid) { php_sxe_object *sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); @@ -58,7 +62,9 @@ SPL_METHOD(SimpleXMLIterator, valid) /* {{{ */ } /* }}} */ -SPL_METHOD(SimpleXMLIterator, current) /* {{{ */ +/* {{{ proto SimpleXMLIterator SimpleXMLIterator::current() + Get current element */ +SPL_METHOD(SimpleXMLIterator, current) { php_sxe_object *sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); @@ -70,7 +76,9 @@ SPL_METHOD(SimpleXMLIterator, current) /* {{{ */ } /* }}} */ -SPL_METHOD(SimpleXMLIterator, key) /* {{{ */ +/* {{{ proto string SimpleXMLIterator::key() + Get name of current child element */ +SPL_METHOD(SimpleXMLIterator, key) { xmlNodePtr curnode; php_sxe_object *intern; @@ -90,7 +98,9 @@ SPL_METHOD(SimpleXMLIterator, key) /* {{{ */ } /* }}} */ -SPL_METHOD(SimpleXMLIterator, next) /* {{{ */ +/* {{{ proto void SimpleXMLIterator::next() + Move to next element */ +SPL_METHOD(SimpleXMLIterator, next) { php_sxe_iterator iter; @@ -99,8 +109,8 @@ SPL_METHOD(SimpleXMLIterator, next) /* {{{ */ } /* }}} */ -/* {{{ hasChildren() - */ +/* {{{ proto bool SimpleXMLIterator::hasChildren() + Check whether element has children (elements) */ SPL_METHOD(SimpleXMLIterator, hasChildren) { php_sxe_object *sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); @@ -123,8 +133,8 @@ SPL_METHOD(SimpleXMLIterator, hasChildren) } /* }}} */ -/* {{{ getChildren() - */ +/* {{{ proto SimpleXMLIterator SimpleXMLIterator::getChildren() + Get child element iterator */ SPL_METHOD(SimpleXMLIterator, getChildren) { php_sxe_object *sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); @@ -136,7 +146,9 @@ SPL_METHOD(SimpleXMLIterator, getChildren) return_value->value.obj = zend_objects_store_clone_obj(sxe->iter.data TSRMLS_CC); } -SPL_METHOD(SimpleXMLIterator, count) /* {{{ */ +/* {{{ proto int SimpleXMLIterator::count() + Get number of child elements */ +SPL_METHOD(SimpleXMLIterator, count) { long count = 0; -- 2.40.0