
Online PHP Coding Standards Fixer - dannie2
http://phpio.net/tools/csfixer
======
docksider
Why do these tools always force me to upload my source? The only time I want
to use something like this is when I'm handed a hot pile of legacy code that
looks like it came out of a blender. And that code I'm not allowed to give
anyone, often will it contain a ton of SQL injections that can be
automatically found.

To me this is useful but absolutely unusable

~~~
lucideer
While I can't see what libraries are behind this tool, it's named "csfixer",
which is the name of a widely used offline tool for PHP[1]

[1] [https://packagist.org/packages/friendsofphp/php-cs-
fixer](https://packagist.org/packages/friendsofphp/php-cs-fixer)

~~~
labrador
Codesniffer also has a decent checker.[1] Actually, the only way I found to
fix legacy code for good is to use the tokenizer and an open source parser to
transform (with code you write) those pesky old bad habits. This one is ok.
[2]

[1]
[https://github.com/squizlabs/PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)
[2] [https://github.com/nikic/PHP-Parser](https://github.com/nikic/PHP-Parser)

------
Tharkun
Surely just about any IDE can do this, without having to upload source code to
some random website?

~~~
Navarr
Most IDEs can integrate with the same tool this uses -
[https://github.com/FriendsOfPHP/PHP-CS-
Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer)

------
ameliaikeda
What's the benefit of this tool over, say, StyleCI or even php-cs-fixer? It
has a hard-to-use UI (in-browser), isn't a standalone tool, and can't be
relied on for dev workflow. You can achieve a similar result just by running
php-cs-fixer, and that would even teach a new user more.

It also changes class names to arbitrary names (e.g. sc_581ef0bae38b2) when
attempting to fix code, which is not at all helpful.

~~~
tomschlick
Yeah StyleCI is the way to go if you want this automated.

------
obayesshelton
why not just install the phpcs package via composer and run it locally?

------
stiGGG
It's funny that you can choose from four standards.

~~~
diggan
Well, to be fair, the standards (PSR 0/1/2) are different and fixes different
things, they are not about fixing the same issues, in different ways. So at
least that's good.

However, what is funny, is that Symfony chose their own standard instead of
going with the rest of the ecosystem. But I come to expect that from Symfony

~~~
0x4a42
This is not true. Symfony is a member of the PHP-FIG group[1], writer of the
PSR standards. The Symfony framework follows PSRs[2] but also has its own
additional set of rules.

[1]
[http://symfony.com/doc/current/contributing/code/standards.h...](http://symfony.com/doc/current/contributing/code/standards.html)

[2]
[http://symfony.com/doc/current/contributing/code/standards.h...](http://symfony.com/doc/current/contributing/code/standards.html)

