com php-src: Add stubs for filter extension: ext/filter/filter.c ext/filter/filter.stub.php ext/filter/filter_arginfo.h
| From: | Nikita Popov | Date: | Tue, 20 Aug 2019 09:04:25 +0000 |
| Subject: | com php-src: Add stubs for filter extension: ext/filter/filter.c ext/filter/filter.stub.php ext/filter/filter_arginfo.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-107965@lists.php.net to get a copy of this message | ||
Commit: a6e1094b6e0c59cd4180eb318b30a1365e90ed57
Author: Henrique Duarte <henrique.duarte@convenia.com.br> Thu, 15 Aug 2019 14:45:22
-0300
Committer: Nikita Popov <nikita.ppv@gmail.com> Tue, 20 Aug 2019 11:04:25 +0200
Parents: af5c637f9667c97c83759dcf8581479aa6636c44
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a6e1094b6e0c59cd4180eb318b30a1365e90ed57
Log:
Add stubs for filter extension
Closes GH-4542.
Changed paths:
M ext/filter/filter.c
A ext/filter/filter.stub.php
A ext/filter/filter_arginfo.h
Diff:
diff --git a/ext/filter/filter.c b/ext/filter/filter.c
index a38aafc..46acfab 100644
--- a/ext/filter/filter.c
+++ b/ext/filter/filter.c
@@ -28,6 +28,7 @@
ZEND_DECLARE_MODULE_GLOBALS(filter)
#include "filter_private.h"
+#include "filter_arginfo.h"
typedef struct filter_list_entry {
const char *name;
@@ -80,45 +81,6 @@ static const filter_list_entry filter_list[] = {
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[] = {
diff --git a/ext/filter/filter.stub.php b/ext/filter/filter.stub.php
new file mode 100644
index 0000000..a4b15cd
--- /dev/null
+++ b/ext/filter/filter.stub.php
@@ -0,0 +1,35 @@
+<?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) {}
diff --git a/ext/filter/filter_arginfo.h b/ext/filter/filter_arginfo.h
new file mode 100644
index 0000000..f5ed690
--- /dev/null
+++ b/ext/filter/filter_arginfo.h
@@ -0,0 +1,38 @@
+/* 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()