Commit addd1da
committed
Add test file for PSR12.Operators.OperatorSpacing
The sniff has specific logic to avoid an out-of-bounds array offset access.
Before now, there were no tests which covered this logic. This commit adds such
a test. The sniff already handles this, so there are no changes required there.
This particular omission was detected by infection/infection.
```diff
src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php:104 [M] FalseValue
@@ @@
}
} else {
// Skip partial files.
- $checkAfter = false;
+ $checkAfter = true;
}
if ($checkBefore === true && $tokens[$stackPtr - 1]['code'] !== T_WHITESPACE) {
$error = 'Expected at least 1 space before "%s"; 0 found';
```1 parent 8581f0c commit addd1da
File tree
1 file changed
+6
-0
lines changed- src/Standards/PSR12/Tests/Operators
1 file changed
+6
-0
lines changedLines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments