Skip to content

Commit

Permalink
Add return type to some array_* functions
Browse files Browse the repository at this point in the history
  • Loading branch information
carusogabriel committed Jun 5, 2019
1 parent 2cfb525 commit 192170a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
12 changes: 6 additions & 6 deletions ext/standard/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -2713,7 +2713,7 @@ PHP_FUNCTION(array_fill_keys)
zend_hash_real_init_packed(Z_ARRVAL_P(return_value)); \
} while (0)

/* {{{ proto array range(mixed low, mixed high[, int step])
/* {{{ proto array|false range(mixed low, mixed high[, int step])
Create an array containing the range of integers or characters from low to high (inclusive) */
PHP_FUNCTION(range)
{
Expand Down Expand Up @@ -3136,7 +3136,7 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H
}
/* }}} */

/* {{{ proto int array_push(array stack, mixed var [, mixed ...])
/* {{{ proto int|false array_push(array stack, mixed var [, mixed ...])
Pushes elements onto the end of the array */
PHP_FUNCTION(array_push)
{
Expand Down Expand Up @@ -3382,7 +3382,7 @@ PHP_FUNCTION(array_unshift)
}
/* }}} */

/* {{{ proto array array_splice(array input, int offset [, int length [, array replacement]])
/* {{{ proto array|null array_splice(array input, int offset [, int length [, array replacement]])
Removes the elements designated by offset and length and replace them with supplied array */
PHP_FUNCTION(array_splice)
{
Expand Down Expand Up @@ -4308,7 +4308,7 @@ PHP_FUNCTION(array_reverse)
}
/* }}} */

/* {{{ proto array array_pad(array input, int pad_size, mixed pad_value)
/* {{{ proto array|false array_pad(array input, int pad_size, mixed pad_value)
Returns a copy of input array padded with pad_value to size pad_size */
PHP_FUNCTION(array_pad)
{
Expand Down Expand Up @@ -5897,7 +5897,7 @@ PHP_FUNCTION(array_rand)
}
/* }}} */

/* {{{ proto mixed array_sum(array input)
/* {{{ proto int|float array_sum(array input)
Returns the sum of the array entries */
PHP_FUNCTION(array_sum)
{
Expand All @@ -5922,7 +5922,7 @@ PHP_FUNCTION(array_sum)
}
/* }}} */

/* {{{ proto mixed array_product(array input)
/* {{{ proto int|float array_product(array input)
Returns the product of the array entries */
PHP_FUNCTION(array_product)
{
Expand Down
32 changes: 16 additions & 16 deletions ext/standard/basic_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,19 +292,19 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_max, 0, 0, 1)
ZEND_ARG_VARIADIC_INFO(0, args)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_array_walk, 0, 0, 2)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_walk, 0, 2, _IS_BOOL, 0)
ZEND_ARG_INFO(1, input) /* ARRAY_INFO(1, arg, 0) */
ZEND_ARG_INFO(0, funcname)
ZEND_ARG_INFO(0, userdata)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_array_walk_recursive, 0, 0, 2)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_walk_recursive, 0, 2, _IS_BOOL, 0)
ZEND_ARG_INFO(1, input) /* ARRAY_INFO(1, arg, 0) */
ZEND_ARG_INFO(0, funcname)
ZEND_ARG_INFO(0, userdata)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_in_array, 0, 0, 2)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_in_array, 0, 2, _IS_BOOL, 0)
ZEND_ARG_INFO(0, needle)
ZEND_ARG_INFO(0, haystack) /* ARRAY_INFO(0, haystack, 0) */
ZEND_ARG_INFO(0, strict)
Expand Down Expand Up @@ -332,7 +332,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_array_fill, 0)
ZEND_ARG_INFO(0, val)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO(arginfo_array_fill_keys, 0)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(arginfo_array_fill_keys, IS_ARRAY, 0)
ZEND_ARG_INFO(0, keys) /* ARRAY_INFO(0, keys, 0) */
ZEND_ARG_INFO(0, val)
ZEND_END_ARG_INFO()
Expand Down Expand Up @@ -360,7 +360,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_array_shift, 0)
ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_array_unshift, 0, 0, 1)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_unshift, 0, 1, IS_LONG, 0)
ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
ZEND_ARG_VARIADIC_INFO(0, vars)
ZEND_END_ARG_INFO()
Expand All @@ -372,18 +372,18 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_array_splice, 0, 0, 2)
ZEND_ARG_INFO(0, replacement) /* ARRAY_INFO(0, arg, 1) */
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_array_slice, 0, 0, 2)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_slice, 0, 2, IS_ARRAY, 0)
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(1, arg, 0) */
ZEND_ARG_INFO(0, offset)
ZEND_ARG_INFO(0, length)
ZEND_ARG_INFO(0, preserve_keys)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge, 0, 0, 0)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_merge, 0, 0, IS_ARRAY, 0)
ZEND_ARG_VARIADIC_INFO(0, arrays)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge_recursive, 0, 0, 0)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_merge_recursive, 0, 0, IS_ARRAY, 0)
ZEND_ARG_VARIADIC_INFO(0, arrays)
ZEND_END_ARG_INFO()

Expand All @@ -397,7 +397,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace_recursive, 0, 0, 1)
ZEND_ARG_VARIADIC_INFO(0, arrays)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_array_keys, 0, 0, 1)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_keys, 0, 1, IS_ARRAY, 0)
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
ZEND_ARG_INFO(0, search_value)
ZEND_ARG_INFO(0, strict)
Expand All @@ -412,7 +412,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_array_key_last, 0)
ZEND_END_ARG_INFO()


ZEND_BEGIN_ARG_INFO(arginfo_array_values, 0)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(arginfo_array_values, IS_ARRAY, 0)
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
ZEND_END_ARG_INFO()

Expand All @@ -426,7 +426,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_array_column, 0, 0, 2)
ZEND_ARG_INFO(0, index_key)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_array_reverse, 0, 0, 1)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_reverse, 0, 1, IS_ARRAY, 0)
ZEND_ARG_INFO(0, input) /* ARRAY_INFO(0, arg, 0) */
ZEND_ARG_INFO(0, preserve_keys)
ZEND_END_ARG_INFO()
Expand All @@ -437,16 +437,16 @@ ZEND_BEGIN_ARG_INFO(arginfo_array_pad, 0)
ZEND_ARG_INFO(0, pad_value)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO(arginfo_array_flip, 0)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(arginfo_array_flip, IS_ARRAY, 0)
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_array_change_key_case, 0, 0, 1)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_change_key_case, 0, 1, IS_ARRAY, 0)
ZEND_ARG_INFO(0, input) /* ARRAY_INFO(0, arg, 0) */
ZEND_ARG_INFO(0, case)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_array_unique, 0, 0, 1)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_unique, 0, 1, IS_ARRAY, 0)
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
ZEND_ARG_INFO(0, flags)
ZEND_END_ARG_INFO()
Expand Down Expand Up @@ -569,7 +569,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_array_reduce, 0, 0, 2)
ZEND_ARG_INFO(0, initial)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_array_filter, 0, 0, 1)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_filter, 0, 1, IS_ARRAY, 0)
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
ZEND_ARG_INFO(0, callback)
ZEND_ARG_INFO(0, use_keys)
Expand All @@ -580,7 +580,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_array_map, 0, 0, 2)
ZEND_ARG_VARIADIC_INFO(0, arrays)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO(arginfo_array_key_exists, 0)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(arginfo_array_key_exists, _IS_BOOL, 0)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, search)
ZEND_END_ARG_INFO()
Expand Down

0 comments on commit 192170a

Please sign in to comment.