|
@@ 79-88 (lines=10) @@
|
| 76 |
|
$leadingComparison = $this->hasLeadingComparison($phpcsFile, $beginningIndex); |
| 77 |
|
$trailingComparison = $this->hasTrailingComparison($phpcsFile, $closingBraceIndex); |
| 78 |
|
|
| 79 |
|
if ($leadingComparison) { |
| 80 |
|
$possibleBeginningIndex = $this->findUnnecessaryLeadingComparisonStart($phpcsFile, $beginningIndex); |
| 81 |
|
if ($possibleBeginningIndex !== null) { |
| 82 |
|
$beginningIndex = $possibleBeginningIndex; |
| 83 |
|
$leadingComparison = false; |
| 84 |
|
if ($tokens[$beginningIndex]['code'] === T_FALSE) { |
| 85 |
|
$negated = !$negated; |
| 86 |
|
} |
| 87 |
|
} |
| 88 |
|
} |
| 89 |
|
|
| 90 |
|
if ($trailingComparison) { |
| 91 |
|
$possibleEndIndex = $this->findUnnecessaryLeadingComparisonStart($phpcsFile, $endIndex); |
|
@@ 90-99 (lines=10) @@
|
| 87 |
|
} |
| 88 |
|
} |
| 89 |
|
|
| 90 |
|
if ($trailingComparison) { |
| 91 |
|
$possibleEndIndex = $this->findUnnecessaryLeadingComparisonStart($phpcsFile, $endIndex); |
| 92 |
|
if ($possibleEndIndex !== null) { |
| 93 |
|
$endIndex = $possibleEndIndex; |
| 94 |
|
$trailingComparison = false; |
| 95 |
|
if ($tokens[$endIndex]['code'] === T_FALSE) { |
| 96 |
|
$negated = !$negated; |
| 97 |
|
} |
| 98 |
|
} |
| 99 |
|
} |
| 100 |
|
|
| 101 |
|
if (!$needsBrackets && ($leadingComparison || $this->leadRequiresBrackets($phpcsFile, $beginningIndex))) { |
| 102 |
|
$needsBrackets = true; |