Skip to content

Commit 05a4001

Browse files
authored
zend_ast: Rename ZEND_AST_METHOD_REFERENCE to ZEND_AST_TRAIT_METHOD_REFERENCE (#21645)
This AST node is specific to traits and thus should include `TRAIT` in its name.
1 parent 144ba8b commit 05a4001

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

UPGRADING.INTERNALS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ PHP 8.6 INTERNALS UPGRADE NOTES
8484
unused. If this behaviour is required fall back to the zend_ini_*
8585
functions.
8686
. The unused ZEND_AST_PARENT_PROPERTY_HOOK_CALL has been removed.
87+
. ZEND_AST_METHOD_REFERENCE has been renamed to
88+
ZEND_AST_TRAIT_METHOD_REFERENCE.
8789

8890
========================
8991
2. Build system changes

Zend/zend_ast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2803,7 +2803,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio
28032803
smart_str_appends(str, " insteadof ");
28042804
zend_ast_export_ex(str, ast->child[1], 0, indent);
28052805
break;
2806-
case ZEND_AST_METHOD_REFERENCE:
2806+
case ZEND_AST_TRAIT_METHOD_REFERENCE:
28072807
if (ast->child[0]) {
28082808
zend_ast_export_name(str, ast->child[0], 0, indent);
28092809
smart_str_appends(str, "::");

Zend/zend_ast.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ enum _zend_ast_kind {
144144
ZEND_AST_DECLARE,
145145
ZEND_AST_USE_TRAIT,
146146
ZEND_AST_TRAIT_PRECEDENCE,
147-
ZEND_AST_METHOD_REFERENCE,
147+
ZEND_AST_TRAIT_METHOD_REFERENCE,
148148
ZEND_AST_NAMESPACE,
149149
ZEND_AST_USE_ELEM,
150150
ZEND_AST_TRAIT_ALIAS,

Zend/zend_language_parser.y

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,13 +1059,13 @@ trait_alias:
10591059

10601060
trait_method_reference:
10611061
identifier
1062-
{ $$ = zend_ast_create(ZEND_AST_METHOD_REFERENCE, NULL, $1); }
1062+
{ $$ = zend_ast_create(ZEND_AST_TRAIT_METHOD_REFERENCE, NULL, $1); }
10631063
| absolute_trait_method_reference { $$ = $1; }
10641064
;
10651065

10661066
absolute_trait_method_reference:
10671067
class_name T_PAAMAYIM_NEKUDOTAYIM identifier
1068-
{ $$ = zend_ast_create(ZEND_AST_METHOD_REFERENCE, $1, $3); }
1068+
{ $$ = zend_ast_create(ZEND_AST_TRAIT_METHOD_REFERENCE, $1, $3); }
10691069
;
10701070

10711071
method_body:

0 commit comments

Comments
 (0)