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.
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
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.
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.
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]
I have something in my bash aliases to tidy my code psr style, however, if I am not on my machine then an online cut and paste is potentially useful. I use such online tools for tidying html, svg and more. Glad to have this on the roster.
15 comments
[ 3.1 ms ] story [ 49.7 ms ] threadIt also changes class names to arbitrary names (e.g. sc_581ef0bae38b2) when attempting to fix code, which is not at all helpful.
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
[1] http://symfony.com/doc/current/contributing/code/standards.h...
[2] http://symfony.com/doc/current/contributing/code/standards.h...
PSR-0 is an autoloading standard
PSR-1 is a basic coding standard
PSR-2 is a coding style guide
I'm very unsure what running code through PSR-0 would do for it, since it's not really about code-style
To me this is useful but absolutely unusable
[1] https://packagist.org/packages/friendsofphp/php-cs-fixer
[1] https://github.com/squizlabs/PHP_CodeSniffer [2] https://github.com/nikic/PHP-Parser