CodeSniffer allows you to create your own ruleset.xml file. Once created, a ruleset file can be used with the --standard command line argument. In the following example, CodeSniffer will use the coding standard defined in the directory MyStandard.
mkdir /tmp/MyStandard
touch /tmp/MyStandard/ruleset.xml
<?xml version="1.0"?>
<ruleset name="MyStandard">
<description>My Standard</description>
<!-- Zend rules -->
<rule ref="Zend" >
<exclude name="Generic.Functions.OpeningFunctionBraceBsdAllman" />
</rule>
<rule ref="Generic.Files.LineEndings">
<properties>
<property name="eolChar" value="\n"/>
</properties>
</rule>
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="140"/>
<property name="absoluteLineLimit" value="140"/>
</properties>
</rule>
<rule ref="MyStandard.PHP.ClassComment"/>
<rule ref="MyStandard.PHP.ClassMethodComment"/>
<rule ref="MyStandard.PHP.FirstCharacter"/>
<rule ref="MyStandard.PHP.ForbiddenStatements"/>
<rule ref="MyStandard.PHP.GlobalKeyword"/>
<rule ref="MyStandard.PHP.LintCheck"/>
<rule ref="MyStandard.PHP.MultiplePHPTags"/>
<rule ref="MyStandard.PHP.Reflection"/>
<rule ref="MyStandard.PHP.SideEffects"/>
<rule ref="MyStandard.PHP.Superglobals"/>
<rule ref="Squiz.Commenting.FunctionCommentThrowTag"/>
<rule ref="Squiz.Operators.ComparisonOperatorUsage"/>
<rule ref="Squiz.Operators.ValidLogicalOperators"/>
<rule ref="Squiz.PHP.DisallowComparisonAssignment"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<rule ref="Generic.Classes.DuplicateClassName"/>
<rule ref="Generic.Functions.CallTimePassByReference"/>
<rule ref="Generic.Metrics.CyclomaticComplexity"/>
<rule ref="Generic.Metrics.NestingLevel"/>
<rule ref="Generic.PHP.NoSilencedErrors"/>
</ruleset>
phpcs --standard=/tmp/MyStandard/ruleset.xml /path/to/dir