Skip to content

Commit 37ead6e

Browse files
committed
Squiz/OperatorBracket: fix regression for new parent
Related to 3546 which fixed an inconsistency after 3484. The change of the tokenization from `T_STRING` to `T_PARENT` for the `parent` keyword caused a regression in the `Squiz.Formatting.OperatorBracket` sniff. Fixed now. Includes unit tests.
1 parent 9445108 commit 37ead6e

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ public function process(File $phpcsFile, $stackPtr)
142142
T_THIS,
143143
T_SELF,
144144
T_STATIC,
145+
T_PARENT,
145146
T_OBJECT_OPERATOR,
146147
T_NULLSAFE_OBJECT_OPERATOR,
147148
T_DOUBLE_COLON,

src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,5 @@ match ($a) {
199199
'b', 'c', 'd' => -2,
200200
default => -3,
201201
};
202+
203+
$cntPages = ceil(count($items) / parent::ON_PAGE);

src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc.fixed

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,5 @@ match ($a) {
199199
'b', 'c', 'd' => -2,
200200
default => -3,
201201
};
202+
203+
$cntPages = ceil(count($items) / parent::ON_PAGE);

0 commit comments

Comments
 (0)