summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Reay <stephen.reay@me.com>2019-08-11 23:32:56 +0700
committerChristoph M. Becker <cmbecker69@gmx.de>2019-08-11 19:03:04 +0200
commitcfbcd4caef558cab23ecacdca57ac5f5a342a5fa (patch)
treeed0993706b4eded697be71205a99bca1290df9af
parent44de46ab69065de2c1b107b3647d69705f9e674d (diff)
downloadphp-git-cfbcd4caef558cab23ecacdca57ac5f5a342a5fa.tar.gz
Arginfo stubs for tokenizer
-rw-r--r--ext/tokenizer/tokenizer.c12
-rw-r--r--ext/tokenizer/tokenizer.stub.php6
-rw-r--r--ext/tokenizer/tokenizer_arginfo.h10
3 files changed, 17 insertions, 11 deletions
diff --git a/ext/tokenizer/tokenizer.c b/ext/tokenizer/tokenizer.c
index 91ace6f701..4a4283f11e 100644
--- a/ext/tokenizer/tokenizer.c
+++ b/ext/tokenizer/tokenizer.c
@@ -24,6 +24,7 @@
#include "php_ini.h"
#include "ext/standard/info.h"
#include "php_tokenizer.h"
+#include "tokenizer_arginfo.h"
#include "zend.h"
#include "zend_exceptions.h"
@@ -42,17 +43,6 @@ void tokenizer_token_get_all_register_constants(INIT_FUNC_ARGS) {
REGISTER_LONG_CONSTANT("TOKEN_PARSE", TOKEN_PARSE, CONST_CS|CONST_PERSISTENT);
}
-/* {{{ arginfo */
-ZEND_BEGIN_ARG_INFO_EX(arginfo_token_get_all, 0, 0, 1)
- ZEND_ARG_INFO(0, source)
- ZEND_ARG_INFO(0, flags)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_token_name, 0, 0, 1)
- ZEND_ARG_INFO(0, token)
-ZEND_END_ARG_INFO()
-/* }}} */
-
/* {{{ tokenizer_functions[]
*
* Every user visible function must have an entry in tokenizer_functions[].
diff --git a/ext/tokenizer/tokenizer.stub.php b/ext/tokenizer/tokenizer.stub.php
new file mode 100644
index 0000000000..8abcd37811
--- /dev/null
+++ b/ext/tokenizer/tokenizer.stub.php
@@ -0,0 +1,6 @@
+<?php
+
+/** @return array|false */
+function token_get_all(string $source, int $flags = 0) {}
+
+function token_name(int $token): string {}
diff --git a/ext/tokenizer/tokenizer_arginfo.h b/ext/tokenizer/tokenizer_arginfo.h
new file mode 100644
index 0000000000..f1b601358e
--- /dev/null
+++ b/ext/tokenizer/tokenizer_arginfo.h
@@ -0,0 +1,10 @@
+/* This is a generated file, edit the .stub.php file instead. */
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_token_get_all, 0, 0, 1)
+ ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_token_name, 0, 1, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, token, IS_LONG, 0)
+ZEND_END_ARG_INFO()