111
111
* @author Marc McIntyre <[email protected] >
112
112
* @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600)
113
113
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
114
- * @version Release: 1.4.2
114
+ * @version Release: @package_version@
115
115
* @link http://pear.php.net/package/PHP_CodeSniffer
116
116
*/
117
117
class PHP_CodeSniffer_File
@@ -1107,7 +1107,7 @@ private static function _convertTabs(&$tokens, $tokenizer, $eolChar)
1107
1107
1108
1108
if (strpos ($ tokenContent , "\t" ) === false ) {
1109
1109
// There are no tabs in this content.
1110
- $ currColumn += ( strlen ($ tokenContent) - 1 );
1110
+ $ currColumn += strlen ($ tokenContent );
1111
1111
} else {
1112
1112
// We need to determine the length of each tab.
1113
1113
$ tabs = preg_split (
@@ -1118,7 +1118,6 @@ private static function _convertTabs(&$tokens, $tokenizer, $eolChar)
1118
1118
);
1119
1119
1120
1120
$ tabNum = 0 ;
1121
- $ adjustedTab = false ;
1122
1121
$ tabsToSpaces = array ();
1123
1122
$ newContent = '' ;
1124
1123
@@ -1140,7 +1139,6 @@ private static function _convertTabs(&$tokens, $tokenizer, $eolChar)
1140
1139
// This is the first tab, and we are already at a
1141
1140
// tab stop, so this tab counts as a single space.
1142
1141
$ currColumn ++;
1143
- $ adjustedTab = true ;
1144
1142
} else {
1145
1143
$ currColumn ++;
1146
1144
while (($ currColumn % PHP_CODESNIFFER_TAB_WIDTH ) != 0 ) {
@@ -1155,19 +1153,13 @@ private static function _convertTabs(&$tokens, $tokenizer, $eolChar)
1155
1153
}//end if
1156
1154
}//end foreach
1157
1155
1158
- if ($ tabNum === 1 && $ adjustedTab === true ) {
1159
- $ currColumn --;
1160
- }
1161
-
1162
1156
$ tokens [$ i ]['content ' ] = $ newContent ;
1163
1157
}//end if
1164
1158
1165
1159
if (isset ($ tokens [($ i + 1 )]['line ' ]) === true
1166
1160
&& $ tokens [($ i + 1 )]['line ' ] !== $ tokens [$ i ]['line ' ]
1167
1161
) {
1168
1162
$ currColumn = 1 ;
1169
- } else {
1170
- $ currColumn ++;
1171
1163
}
1172
1164
}//end for
1173
1165
0 commit comments