Permalink
Browse files

Add zend_parse_parameters_none() calls for void methods

  • Loading branch information...
1 parent f9985dc commit 2d07759e47fe53afe65cae227fece563ce604264 @nikic committed Jan 7, 2012
Showing with 33 additions and 7 deletions.
  1. +17 −7 spl_ds_dll.c
  2. +8 −0 spl_ds_queue.c
  3. +8 −0 spl_ds_stack.c
View
@@ -202,28 +202,38 @@ void spl_ds_dll_object_clone_storage(spl_ds_dll_object *obj_orig, spl_ds_dll_obj
SPL_DS_METHOD(DLL, clear)
{
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
spl_ds_dll_clear(SPL_DS_DLL_GET_LIST());
}
SPL_DS_METHOD(DLL, isEmpty)
{
- if (spl_ds_dll_is_empty(SPL_DS_DLL_GET_LIST())) {
- RETURN_TRUE;
- } else {
- RETURN_FALSE;
- }
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
+ RETURN_BOOL(spl_ds_dll_is_empty(SPL_DS_DLL_GET_LIST()));
}
SPL_DS_METHOD(DLL, toArray)
{
zval *retval = spl_ds_dll_to_array(SPL_DS_DLL_GET_LIST());
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
RETURN_ZVAL(retval, 1, 1);
}
SPL_DS_METHOD(DLL, count)
{
- long count = spl_ds_dll_count(SPL_DS_DLL_GET_LIST());
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
- RETURN_LONG(count);
+ RETURN_LONG(spl_ds_dll_count(SPL_DS_DLL_GET_LIST()));
}
View
@@ -37,6 +37,10 @@ SPL_DS_METHOD(Queue, peek)
spl_ds_dll *list;
zval *item;
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
list = SPL_DS_DLL_GET_LIST();
if (spl_ds_dll_is_empty(list)) {
@@ -53,6 +57,10 @@ SPL_DS_METHOD(Queue, pop)
spl_ds_dll *list;
zval *item;
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
list = SPL_DS_DLL_GET_LIST();
if (spl_ds_dll_is_empty(list)) {
View
@@ -37,6 +37,10 @@ SPL_DS_METHOD(Stack, peek)
spl_ds_dll *list;
zval *item;
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
list = SPL_DS_DLL_GET_LIST();
if (spl_ds_dll_is_empty(list)) {
@@ -53,6 +57,10 @@ SPL_DS_METHOD(Stack, pop)
spl_ds_dll *list;
zval *item;
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
list = SPL_DS_DLL_GET_LIST();
if (spl_ds_dll_is_empty(list)) {

0 comments on commit 2d07759

Please sign in to comment.