Skip to content

Commit ce2aa58

Browse files
committed
Fixed bug squizlabs#2423 : Squiz.Formatting.OperatorBracket.MissingBrackets error with static
1 parent fd2158b commit ce2aa58

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
2828
<notes>
2929
- Squiz.Arrays.ArrayDeclaration now has improved handling of syntax errors
3030
- Fixed bug #2414 : Indention false positive in switch/case/if combination
31+
- Fixed bug #2423 : Squiz.Formatting.OperatorBracket.MissingBrackets error with static
3132
- Fixed bug #2450 : Indentation false positive when closure containing nested IF conditions used as function argument
3233
- Fixed bug #2452 : LowercasePHPFunctions sniff failing on "new \File()"
3334
- Fixed bug #2453 : Squiz.CSS.SemicolonSpacingSniff false positive when style name proceeded by an asterisk

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ public function process(File $phpcsFile, $stackPtr)
138138
T_NS_SEPARATOR,
139139
T_THIS,
140140
T_SELF,
141+
T_STATIC,
141142
T_OBJECT_OPERATOR,
142143
T_DOUBLE_COLON,
143144
T_OPEN_SQUARE_BRACKET,
@@ -280,6 +281,7 @@ public function addMissingBracketsError($phpcsFile, $stackPtr)
280281
T_NS_SEPARATOR => true,
281282
T_THIS => true,
282283
T_SELF => true,
284+
T_STATIC => true,
283285
T_OBJECT_OPERATOR => true,
284286
T_DOUBLE_COLON => true,
285287
T_MODULUS => true,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,6 @@ $foo = $bar ?? $baz ?? '';
167167
$foo = $myString{-1};
168168

169169
$value = (binary) $blah + b"binary $foo";
170+
171+
$test = (1 * static::TEST);
172+
$test = myfunc(1 * static::TEST);

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,6 @@ $foo = ($bar ?? $baz ?? '');
167167
$foo = $myString{-1};
168168

169169
$value = ((binary) $blah + b"binary $foo");
170+
171+
$test = (1 * static::TEST);
172+
$test = myfunc(1 * static::TEST);

0 commit comments

Comments
 (0)