tags:

views:

87

answers:

2

Could you please recommend some software that will do PHP code polishing according to pre-defined formatting rules?

Thanks!

+1  A: 

I use Polystyle. It's quite nice and has very customizable rules. Costs $15, trial version is available. Is worth the money.

There are free ones around as well. I think there is a good formatter in some Eclipse PHP package (I forgot the name) and there is the on-line PHP Beautifier service (that one doesn't have any formatting rules, though).

Pekka
+1 for Eclipse!
Veger
Do you know the name of the tool? I'll be happy to add it.
Pekka
Afaik, it is Eclipse's Java formatter ported to PHP. It's internal, not some external tool wrapped into Eclipse. So nothing you could use outside Eclipse or Zend Studio.
Gordon
Polystyle is a standalone windows application.. brrr..
Vincenzo
I found PHP_Beautifier, and it looks as a professional tool for the task explained above. But it's not supported actively now, as I see...
Vincenzo
+1  A: 

I use codesniffer (http://pear.php.net/package/PHP_CodeSniffer) to check my code and keep it nice and tidy. It doesn't do any re-formatting tho, just displays a list of errors based on whichever standard you choose to check against then you go fix them by hand. Personally I prefer that tho. Its also very flexible and you can add your own standards or amend the existing ones using php

Addsy