]> granicus.if.org Git - php/commitdiff
Arginfo stubs for tokenizer
authorStephen Reay <stephen.reay@me.com>
Sun, 11 Aug 2019 16:32:56 +0000 (23:32 +0700)
committerChristoph M. Becker <cmbecker69@gmx.de>
Sun, 11 Aug 2019 17:03:04 +0000 (19:03 +0200)
ext/tokenizer/tokenizer.c
ext/tokenizer/tokenizer.stub.php [new file with mode: 0644]
ext/tokenizer/tokenizer_arginfo.h [new file with mode: 0644]

index 91ace6f701770235c728332403b6e19d90cfb8a1..4a4283f11e0b4faa2357975070988be0c8f5453b 100644 (file)
@@ -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 (file)
index 0000000..8abcd37
--- /dev/null
@@ -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 (file)
index 0000000..f1b6013
--- /dev/null
@@ -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()