Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am just wonedering is there a tool/software (ideally free) to do a auto code formatting in the PHP for batch of files (not one by one which i can use the IDE for that)

Ideally something like this where i can set the settings and it will do the auto formatting for all the files in side that folder ...etc http://beta.phpformatter.com/

this is very useful but issue is i have to do this one by one copy pasting .. thats why i am looking for another tool..

share|improve this question

put on hold as off-topic by Martijn Pieters, amon, MichaelT, gnat, Ampt Sep 15 at 1:08

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Martijn Pieters, amon, MichaelT, gnat, Ampt
If this question can be reworded to fit the rules in the help center, please edit the question.

PHPFormatter does a POST to beta.phpformatter.com/Output with a url_escaped version of the unformatted code as parameter. And outputs a JSON in which the output property contains the formatted code. You can CURL this yourself for a set of files via the command line or a script. **Disclaimer: ** Just an idea. Don't blame me, if PHPFormatter.com sues you! –  techfoobar Sep 27 '12 at 7:34

3 Answers 3

I'm happily using https://github.com/fabpot/PHP-CS-Fixer

You also have some control on what to fix. For example:

$ php-cs-fixer fix . --level=all --fixers=-visibility,-return,-phpdoc_params,-controls_spaces
share|improve this answer

I believe NetBeans will do what you want, and it is free.

share|improve this answer

PHP designer can do that. Though it is an editor, it can format all the php files in the project. It isa paid software and can be found here: http://www.mpsoftware.dk/

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.