6 ms·
Online PHP Coding Standards Fixer
- ameliaikeda 10y agoWhat'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 10y agoYeah StyleCI is the way to go if you want this automated.
- stiGGG 10y agoIt's funny that you can choose from four standards.
- diggan 10y agoWell, 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
- tomschlick 10y agoI believe Symfony's standard existed before the PHP-FIG which made the PSRs.
- 0x4a42 10y agoThis 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.html http://symfony.com/doc/current/contributing/code/standards.h... [2] http://symfony.com/doc/current/contributing/code/standards.html http://symfony.com/doc/current/contributing/code/standards.h...
- Navarr 10y agoPSR-0, 1, and 2 build off of the previous one. 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
- docksider 10y agoWhy 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 10y agoWhile 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 10y agoCodesniffer 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
- Theodores 10y agoI 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.
- dannie2 10y agoThat's right. Sometimes we need to do it online.
- Tharkun 10y agoSurely just about any IDE can do this, without having to upload source code to some random website?
- Navarr 10y agoMost IDEs can integrate with the same tool this uses - https://github.com/FriendsOfPHP/PHP-CS-Fixer https://github.com/FriendsOfPHP/PHP-CS-Fixer
- obayesshelton 10y agowhy not just install the phpcs package via composer and run it locally?