Skip to content

Commit d2e9d77

Browse files
committed
Declare ext/tokenizer constants in stubs
1 parent 5c693c7 commit d2e9d77

File tree

8 files changed

+935
-185
lines changed

8 files changed

+935
-185
lines changed

ext/tokenizer/php_tokenizer.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ extern zend_module_entry tokenizer_module_entry;
2323
#include "php_version.h"
2424
#define PHP_TOKENIZER_VERSION PHP_VERSION
2525

26+
#define TOKEN_PARSE (1 << 0)
27+
2628
#ifdef ZTS
2729
#include "TSRM.h"
2830
#endif
2931

30-
void tokenizer_register_constants(INIT_FUNC_ARGS);
3132
char *get_token_type_name(int token_type);
3233

3334

ext/tokenizer/tokenizer.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "php_ini.h"
2323
#include "ext/standard/info.h"
2424
#include "php_tokenizer.h"
25+
#include "tokenizer_data_arginfo.h"
2526
#include "tokenizer_arginfo.h"
2627

2728
#include "zend.h"
@@ -36,14 +37,8 @@
3637
#define zendcursor LANG_SCNG(yy_cursor)
3738
#define zendlimit LANG_SCNG(yy_limit)
3839

39-
#define TOKEN_PARSE (1 << 0)
40-
4140
zend_class_entry *php_token_ce;
4241

43-
void tokenizer_token_get_all_register_constants(INIT_FUNC_ARGS) {
44-
REGISTER_LONG_CONSTANT("TOKEN_PARSE", TOKEN_PARSE, CONST_CS|CONST_PERSISTENT);
45-
}
46-
4742
/* {{{ tokenizer_module_entry */
4843
zend_module_entry tokenizer_module_entry = {
4944
STANDARD_MODULE_HEADER,
@@ -251,8 +246,8 @@ PHP_METHOD(PhpToken, __toString)
251246
/* {{{ PHP_MINIT_FUNCTION */
252247
PHP_MINIT_FUNCTION(tokenizer)
253248
{
254-
tokenizer_register_constants(INIT_FUNC_ARGS_PASSTHRU);
255-
tokenizer_token_get_all_register_constants(INIT_FUNC_ARGS_PASSTHRU);
249+
register_tokenizer_data_symbols(module_number);
250+
register_tokenizer_symbols(module_number);
256251
php_token_ce = register_class_PhpToken(zend_ce_stringable);
257252

258253
return SUCCESS;

ext/tokenizer/tokenizer.stub.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
/** @generate-class-entries */
44

5+
/**
6+
* @var int
7+
* @cvalue TOKEN_PARSE
8+
*/
9+
const TOKEN_PARSE = UNKNOWN;
10+
511
function token_get_all(string $code, int $flags = 0): array {}
612

713
function token_name(int $id): string {}

ext/tokenizer/tokenizer_arginfo.h

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/tokenizer/tokenizer_data.c

Lines changed: 0 additions & 151 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)