Closes GH-4542.
ZEND_DECLARE_MODULE_GLOBALS(filter)
#include "filter_private.h"
+#include "filter_arginfo.h"
typedef struct filter_list_entry {
const char *name;
static unsigned int php_sapi_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len);
static unsigned int php_sapi_filter_init(void);
-/* {{{ arginfo */
-ZEND_BEGIN_ARG_INFO_EX(arginfo_filter_input, 0, 0, 2)
- ZEND_ARG_INFO(0, type)
- ZEND_ARG_INFO(0, variable_name)
- ZEND_ARG_INFO(0, filter)
- ZEND_ARG_INFO(0, options)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_filter_var, 0, 0, 1)
- ZEND_ARG_INFO(0, variable)
- ZEND_ARG_INFO(0, filter)
- ZEND_ARG_INFO(0, options)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_filter_input_array, 0, 0, 1)
- ZEND_ARG_INFO(0, type)
- ZEND_ARG_INFO(0, definition)
- ZEND_ARG_INFO(0, add_empty)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_filter_var_array, 0, 0, 1)
- ZEND_ARG_INFO(0, data)
- ZEND_ARG_INFO(0, definition)
- ZEND_ARG_INFO(0, add_empty)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_filter_list, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_filter_has_var, 0, 0, 2)
- ZEND_ARG_INFO(0, type)
- ZEND_ARG_INFO(0, variable_name)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_filter_id, 0, 0, 1)
- ZEND_ARG_INFO(0, filtername)
-ZEND_END_ARG_INFO()
-/* }}} */
-
/* {{{ filter_functions[]
*/
static const zend_function_entry filter_functions[] = {
--- /dev/null
+<?php
+
+function filter_has_var(int $type, string $variable_name): bool {}
+
+/**
+ * @param mixed $options
+ * @return mixed
+ */
+function filter_input(int $type, string $variable_name, int $filter = FILTER_DEFAULT, $options = NULL) {}
+
+/**
+ * @param mixed $variable
+ * @param mixed $options
+ * @return mixed
+ */
+function filter_var($variable, int $filter = FILTER_DEFAULT, $options = NULL) {}
+
+/**
+ * @param mixed $options
+ * @return mixed
+ */
+function filter_input_array(int $type, $options = NULL, bool $add_empty = true) {}
+
+/**
+ * @param mixed $options
+ * @return mixed
+ */
+function filter_var_array(array $data, $options = NULL, bool $add_empty = true) {}
+
+function filter_list(): array {}
+
+/**
+ * @return int|false
+ */
+function filter_id(string $filtername) {}
--- /dev/null
+/* This is a generated file, edit the .stub.php file instead. */
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_filter_has_var, 0, 2, _IS_BOOL, 0)
+ ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, variable_name, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_filter_input, 0, 0, 2)
+ ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, variable_name, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, filter, IS_LONG, 0)
+ ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_filter_var, 0, 0, 1)
+ ZEND_ARG_INFO(0, variable)
+ ZEND_ARG_TYPE_INFO(0, filter, IS_LONG, 0)
+ ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_filter_input_array, 0, 0, 1)
+ ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0)
+ ZEND_ARG_INFO(0, options)
+ ZEND_ARG_TYPE_INFO(0, add_empty, _IS_BOOL, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_filter_var_array, 0, 0, 1)
+ ZEND_ARG_TYPE_INFO(0, data, IS_ARRAY, 0)
+ ZEND_ARG_INFO(0, options)
+ ZEND_ARG_TYPE_INFO(0, add_empty, _IS_BOOL, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_filter_list, 0, 0, IS_ARRAY, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_filter_id, 0, 0, 1)
+ ZEND_ARG_TYPE_INFO(0, filtername, IS_STRING, 0)
+ZEND_END_ARG_INFO()