Skip to content

Commit a8bafca

Browse files
author
s.duge
committed
- adding var in else
1 parent 6db90c8 commit a8bafca

File tree

1 file changed

+2
-0
lines changed
  • custom-standards/Flyeralarm/Sniffs/ControlStructures

1 file changed

+2
-0
lines changed

custom-standards/Flyeralarm/Sniffs/ControlStructures/YodaSniff.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public function process(File $phpcsFile, $stackPtr)
2828
$startOfConditionPtr = $stackPtr;
2929
if (array_key_exists('scope_opener', $tokens[$startOfConditionPtr])) {
3030
$endPtr = $tokens[$startOfConditionPtr]['scope_opener'] + 1;
31+
} else {
32+
$endPtr = null;
3133
}
3234

3335
$logicalOperatorTokenIds = [T_BOOLEAN_AND, T_BOOLEAN_OR, T_LOGICAL_AND, T_LOGICAL_OR, T_LOGICAL_XOR];

0 commit comments

Comments
 (0)