Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@trovster
Created June 20, 2019 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trovster/e49bc757ca2532eb2742880920324115 to your computer and use it in GitHub Desktop.
Save trovster/e49bc757ca2532eb2742880920324115 to your computer and use it in GitHub Desktop.
Code Sniffer config for Laravel 5 Applications
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="iSite">
<description>Code Sniffer Laravel, including PSR2, SlevomatCodingStandard and ImportDetection.</description>
<file>app/</file>
<file>config/</file>
<file>public/</file>
<file>resources/</file>
<file>routes/</file>
<file>tests/</file>
<exclude-pattern>/public/index.php</exclude-pattern>
<exclude-pattern>*/cache/*</exclude-pattern>
<exclude-pattern>*/*.js</exclude-pattern>
<exclude-pattern>*/*.css</exclude-pattern>
<exclude-pattern>*/*.xml</exclude-pattern>
<exclude-pattern>*/autoload.php</exclude-pattern>
<exclude-pattern>*/storage/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/libraries/phpdocx_pro_conv/*</exclude-pattern>
<arg name="report" value="summary"/>
<arg name="colors"/>
<arg value="p"/>
<ini name="memory_limit" value="128M"/>
<rule ref="PSR12">
<exclude name="PSR12.Classes.ClassInstantiation"/>
</rule>
<rule ref="PSR2">
<exclude name="PSR2.Methods.MethodDeclaration.Underscore"/>
</rule>
<rule ref="Internal.NoCodeFound">
<severity>0</severity>
</rule>
<rule ref="Internal.Exception">
<severity>0</severity>
</rule>
<rule ref="PSR1">
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
</rule>
<rule ref="SlevomatCodingStandard.PHP"></rule>
<rule ref="SlevomatCodingStandard.Commenting">
<exclude name="SlevomatCodingStandard.Commenting.DisallowOneLinePropertyDocComment"/>
</rule>
<rule ref="SlevomatCodingStandard.Functions">
<exclude name="SlevomatCodingStandard.Functions.TrailingCommaInCall"/>
<exclude name="SlevomatCodingStandard.Functions.StaticClosure.ClosureNotStatic"/>
</rule>
<rule ref="SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter">
<exclude-pattern>app/Providers/RouteServiceProvider.php</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces">
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions"/>
<exclude name="SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces"/>
<exclude name="SlevomatCodingStandard.Namespaces.UseFromSameNamespace.UseFromSameNamespace"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions.NonFullyQualifiedException"/>
</rule>
<rule ref="SlevomatCodingStandard.Classes">
<exclude name="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces"/>
<exclude name="SlevomatCodingStandard.Classes.TraitUseSpacing"/>
</rule>
<rule ref="SlevomatCodingStandard.Files">
<exclude name="SlevomatCodingStandard.Files.TypeNameMatchesFileName.NoMatchBetweenTypeNameAndFileName"/>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints">
<exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"/>
<exclude name="SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint"/>
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableParameterTypeHintSpecification"/>
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversablePropertyTypeHintSpecification"/>
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableReturnTypeHintSpecification"/>
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint"/>
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint"/>
</rule>
<rule ref="ImportDetection">
<exclude-pattern>resources/views/**/*.php</exclude-pattern>
<exclude-pattern>config/app.php</exclude-pattern>
<properties>
<property name="ignoreUnimportedSymbols" value="/^(PDO|Route|Form|request|response|redirect|abort|app|now|value|factory|collect|config|view|url|old|route|env|app_path|database_path|storage_path|base_path|public_path|resource_path|generateUUID)$/"/>
</properties>
</rule>
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="500"/>
<property name="absoluteLineLimit" value="0"/>
</properties>
</rule>
</ruleset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment