Skip to content

Commit

Permalink
Removed redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
nilportugues committed Nov 10, 2015
1 parent d9bfb42 commit ca6848f
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/BackslashFixer/Fixer/FileEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,12 @@ public function addBackslashes($path)
}

//isConstant
if (!empty($constants[strtoupper($token[1])])
&& $previousToken[0] != T_NAMESPACE
&& !in_array(strtolower($token[1]), ['true', 'false', 'null'])
) {
if (!empty($constants[strtoupper($token[1])]) && $previousToken[0] != T_NAMESPACE) {
$line = $token[2];
$source[$line-1] = str_replace($token[1], '\\'.$token[1], $source[$line-1]);
}
}

if (in_array(strtolower($token[1]), ['true', 'false', 'null'])) {
$line = $token[2];
$source[$line-1] = str_replace($token[1], '\\'.$token[1], $source[$line-1]);
}

$previousToken = $token;
}

Expand Down

0 comments on commit ca6848f

Please sign in to comment.