Added codesniffer to the dev requirements. Updated gitignore to ignore composer.phar.
PSR2 style fixes and added brackets to make the logic a bit cleaner.