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
    
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
add comment

3 Answers

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
add comment

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
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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