The PHP Code Sniffer helps identity violations again coding standards (ie. PSR) as well as syntax errors in your code. The following tutorial explains how to setup the PHP Code Sniffer in Sublime Text (on OSX). This has been tested in Sublime Text 2 and Sublime Text 3.
You can use Pear, but that's just confusing, and requires you to have Pear installed. Move on to the next option.