#!/bin/sh

# 1. Install the php-cs-fixer command-line tool: https://github.com/fabpot/PHP-CS-Fixer
# 2. Run this script.

php-cs-fixer fix . \
    --fixers=indentation,linefeed,trailing_spaces,unused_use,short_tag,include,php_closing_tag,extra_empty_lines,controls_spaces,eof_ending

# NOTE(cakoose): The fixers I'm intentionally excluding and why I'm excluding them:
# - phpdoc_params: This puts two spaces after the '@param', which I didn't like.
# - visibility: In PHP, if you don't specify a visibility modifier, it's 'public'.  This seems a
#   reasonable default and I don't see any advantages to being verbose and saying 'public' each
#   time.
# - return: This is annoying for two-line functions where you check something and then return.
# - braces: Different brace styles don't really bother me, but I'm not strongly opposed to forcing
#   one style, though.
# - psr0: I don't object to what this is trying to enforce, but it makes breaking changes to your
#   code.
# - elseif: I'm not strongly opposed, but I don't see the advantage.
