Fixed code style
Fixed some "Line indented incorrectly" issues
Replaced tabs with 4 spaces
Removed closing tag
Put opening braces on a new line
Fixed phpcs' complaints about multi-line statements
Don't use inline control structures
Replaced `else if` with `elseif`
Added test cases for travis ci