This tutorial describes how to set PHP_CodeSniffer as the local project dependency instead of the suggested global PEAR dependency.
Follow the https://github.com/squizlabs/PHP_CodeSniffer/blob/master/README.markdown
Add the following configuration to your composer.json