Skip to content

Commit 62dee28

Browse files
ondrejmirtesnikic
authored andcommitted
Rename ParserAbstract method checkPropertyHookList to checkEmptyPropertyHookList
1 parent b396e9e commit 62dee28

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

grammar/php.y

+2-2
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ class_statement:
840840
#if PHP8
841841
| optional_attributes variable_modifiers optional_type_without_static property_declaration_list '{' property_hook_list '}'
842842
{ $$ = new Stmt\Property($2, $4, attributes(), $3, $1, $6);
843-
$this->checkPropertyHookList($6, #5); }
843+
$this->checkEmptyPropertyHookList($6, #5); }
844844
#endif
845845
| optional_attributes method_modifiers T_CONST class_const_list semi
846846
{ $$ = new Stmt\ClassConst($4, $2, attributes(), $1);
@@ -949,7 +949,7 @@ property_hook_list:
949949
optional_property_hook_list:
950950
/* empty */ { $$ = []; }
951951
#if PHP8
952-
| '{' property_hook_list '}' { $$ = $2; $this->checkPropertyHookList($2, #1); }
952+
| '{' property_hook_list '}' { $$ = $2; $this->checkEmptyPropertyHookList($2, #1); }
953953
#endif
954954
;
955955

lib/PhpParser/Parser/Php8.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1993,7 +1993,7 @@ protected function initReduceCallbacks(): void {
19931993
},
19941994
348 => static function ($self, $stackPos) {
19951995
$self->semValue = new Stmt\Property($self->semStack[$stackPos-(7-2)], $self->semStack[$stackPos-(7-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(7-3)], $self->semStack[$stackPos-(7-1)], $self->semStack[$stackPos-(7-6)]);
1996-
$self->checkPropertyHookList($self->semStack[$stackPos-(7-6)], $stackPos-(7-5));
1996+
$self->checkEmptyPropertyHookList($self->semStack[$stackPos-(7-6)], $stackPos-(7-5));
19971997
},
19981998
349 => static function ($self, $stackPos) {
19991999
$self->semValue = new Stmt\ClassConst($self->semStack[$stackPos-(5-4)], $self->semStack[$stackPos-(5-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(5-1)]);
@@ -2122,7 +2122,7 @@ protected function initReduceCallbacks(): void {
21222122
$self->semValue = [];
21232123
},
21242124
394 => static function ($self, $stackPos) {
2125-
$self->semValue = $self->semStack[$stackPos-(3-2)]; $self->checkPropertyHookList($self->semStack[$stackPos-(3-2)], $stackPos-(3-1));
2125+
$self->semValue = $self->semStack[$stackPos-(3-2)]; $self->checkEmptyPropertyHookList($self->semStack[$stackPos-(3-2)], $stackPos-(3-1));
21262126
},
21272127
395 => static function ($self, $stackPos) {
21282128
$self->semValue = new Node\PropertyHook($self->semStack[$stackPos-(5-4)], $self->semStack[$stackPos-(5-5)], ['flags' => $self->semStack[$stackPos-(5-2)], 'byRef' => $self->semStack[$stackPos-(5-3)], 'params' => [], 'attrGroups' => $self->semStack[$stackPos-(5-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));

lib/PhpParser/ParserAbstract.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ protected function checkUseUse(UseItem $node, int $namePos): void {
11591159
}
11601160

11611161
/** @param PropertyHook[] $hooks */
1162-
protected function checkPropertyHookList(array $hooks, int $hookPos): void {
1162+
protected function checkEmptyPropertyHookList(array $hooks, int $hookPos): void {
11631163
if (empty($hooks)) {
11641164
$this->emitError(new Error(
11651165
'Property hook list cannot be empty', $this->getAttributesAt($hookPos)));

0 commit comments

Comments
 (0)