first of all install php code sniffer:
pear install PHP_CodeSniffer
as rules / hook may change during time, do NOT copy them directly, instead use soft link.
cd /path/to/pear/PHP/CodeSniffer/Standards/
ln -s /path/to/xamin-std/phpcs-rules/Xamin Xamin
cd /path/to/your/git/project/.git/hooks/
ln -s /path/to/xamin-std/git-hooks/pre-commit pre-commit
note: you can ignore this hook with --no-verify switch.
phpcs --standard=Xamin file.php
take a look at php-cs example
directory