views:

56

answers:

1

I am wondering if there is a tool, that will parse a PHP project and fix a bad code style.

That is a double quoted string that has no variables should be changed to single quote.

$var1="change enclosing to single quote"."here too";
$var2="change enclosing in this string but keep $i"."change it here";

I would like to rewrite automatically in entire project to:

$var1='change enclosing to single quote'.'here too';
$var2='do not change enclosing in this string '.$i.'change it here';
+1  A: 

PHP codesniffer will show these for you so you can change them before you commit code to the repository but this method is preventative not fixing something afterwards...

http://pear.php.net/package/PHP_CodeSniffer/redirected

This is a methodology you should follow when developing.

etbal