First install the PHP CodeSniffer libraries out of Pear

with Pear Install:

pear install PHP_CodeSniffer

Then in Eclipse go to

Run -> External Tools -> External Tools Configuration

And configure as below

Eclipse Configuration