Commit 3abedb7
committed
PHPCSDebug/TokenList: always show original content when available
When the `tab-width` configuration variable has been set for PHPCS - either via the config, via a ruleset or via the command-line -, PHPCS will replace tabs with spaces in the `'content'` and retain the original content in a `'orig_content'` key.
Previously, this "original content" would only be shown for whitespace tokens. However, tab replacement can also happen in other tokens. Typically tabs may also be found in text strings and comments contents.
This commit adjusts the sniff to _always_ show the "original content" if that array key has been set in the token array.
Whitespace visualization will be enabled in that case for both the `'content'` as well as the `'orig_content'` so the "tabs vs spaces" difference can be clearly seen.1 parent 79a70d6 commit 3abedb7
1 file changed
+5
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
113 | 113 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 114 | + | |
121 | 115 | | |
122 | 116 | | |
123 | 117 | | |
| |||
0 commit comments