Commit 6593e66
committed
minor #4699 LineEndingFixer - handle "\r\r\n" (kubawerlos)
This PR was squashed before being merged into the 2.15 branch (closes #4699).
Discussion
----------
LineEndingFixer - handle "\r\r\n"
The added test is converting the input to expected, but it fails because:
> Code build on input code must match expected code.
We have two ways to fix it:
1. Update the RegEx `#\r\n|\n#` to `#\r+\n|\n#`
2. Update the RegEx `#\r\n|\n#` to `#\r\n|\r|\n#` and test case to:
```php
$cases[] = [
"<?php echo 'foo',\n\n'bar';",
"<?php echo 'foo',\r\r\n'bar';",
];
```
Option 2 seems more right as the original `\r\r\n` is treated (at least in PHPStorm) as 2 line endings.
Ping @fabpot, @SpacePossum and @keradus as authors for opinion.
Commits
-------
b465a72 LineEndingFixer - handle \"\r\r\n\"File tree
2 files changed
+7
-2
lines changed- src/Fixer/Whitespace
- tests/Fixer/Whitespace
2 files changed
+7
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
63 | 68 | | |
64 | 69 | | |
65 | 70 | | |
| |||
0 commit comments