forked from sa4250mnpo70/dropbox-sdk-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fix-style
executable file
·19 lines (16 loc) · 1.02 KB
/
fix-style
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/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.