nanch / phpfmt_stable

This is a stable snapshot (version 6125cf9) of the phpfmt plugin for Sublime Text
143 stars 34 forks source link

How to use phpfmt in command line? #62

Open eduardoarandah opened 4 years ago

eduardoarandah commented 4 years ago

Is it possible to use phpfmt in command line?

I know about phpcs and phpcbf but they don’t align arrows

remorse commented 4 years ago

If you have this in a repository at /path/to/repo, you should be able to run it with something like:

/usr/bin/php \
    /path/to/repo/fmt.phar \
    --enable_auto_align \
    --smart_linebreak_after_curly \
    --passes=ReindentSwitchBlocks,SplitCurlyCloseAndTokens \
    -o=<output> \
    <file>

with, of course, your own options.