Skip to content

Commit 0ccfd6e

Browse files
committed
Add PHPCS config file with PSR-2 as base code style standard & some more
https://www.php-fig.org/psr/psr-2/
1 parent a4f492a commit 0ccfd6e

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

phpcs.xml.dist

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="MS SQL Server Examples">
3+
<description>The coding standard for MS SQL Server PHP Examples.</description>
4+
5+
<!-- Folders & files to be checked -->
6+
<file>samples/tutorials/php</file>
7+
8+
<!-- File extensions to be checked -->
9+
<arg name="extensions" value="php"/>
10+
11+
<!-- PSR-2 base standard -->
12+
<rule ref="PSR2"/>
13+
14+
<!-- General sniffs -->
15+
<rule ref="Generic.Files.LineLength"/>
16+
<rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
17+
<rule ref="Squiz.Commenting.FunctionCommentThrowTag"/>
18+
<rule ref="Squiz.Classes.LowercaseClassKeywords"/>
19+
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
20+
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
21+
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
22+
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
23+
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
24+
<rule ref="Squiz.Commenting.DocCommentAlignment"/>
25+
<rule ref="Generic.Formatting.NoSpaceAfterCast"/>
26+
<rule ref="Squiz.Operators.ValidLogicalOperators"/>
27+
<rule ref="Generic.PHP.DeprecatedFunctions"/>
28+
<rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/>
29+
<rule ref="Squiz.PHP.Eval"/>
30+
<rule ref="Generic.PHP.ForbiddenFunctions"/>
31+
<rule ref="Squiz.PHP.NonExecutableCode"/>
32+
<rule ref="Squiz.Classes.ClassFileName"/>
33+
<rule ref="Squiz.Scope.MemberVarScope"/>
34+
<rule ref="Squiz.Scope.StaticThisUsage"/>
35+
<rule ref="Squiz.WhiteSpace.CastSpacing"/>
36+
<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>
37+
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
38+
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
39+
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
40+
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace"/>
41+
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
42+
<properties>
43+
<property name="equalsSpacing" value="1"/>
44+
</properties>
45+
</rule>
46+
47+
</ruleset>

0 commit comments

Comments
 (0)