Skip to content

Commit a42a586

Browse files
committed
initial commit
0 parents  commit a42a586

6 files changed

Lines changed: 176 additions & 0 deletions

File tree

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[*]
2+
end_of_line = lf
3+
insert_final_newline = true
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 4
7+
trim_trailing_whitespace = true
8+
9+
[*.md]
10+
trim_trailing_whitespace = false
11+
12+
# Tab indentation (no size specified)
13+
[Makefile]
14+
indent_style = tab

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
vendor/
2+
.idea/

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
Copyright (c) 2016 Prezly.com
3+
4+
Permission is hereby granted, free of charge,
5+
to any person obtaining a copy of this software and associated documentation files (the "Software"),
6+
to deal in the Software without restriction,
7+
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
and/or sell copies of the Software,
9+
and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included
13+
in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Prezly's Code Style
2+
===================
3+

composer.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "prezly/code-style",
3+
"type": "library",
4+
"description": "Code style for prezly projects",
5+
"license": "MIT",
6+
"require": {
7+
"squizlabs/php_codesniffer": "~3.0.0RC1"
8+
},
9+
"require-dev": {},
10+
"autoload": {}
11+
}

prezly.phpcs.xml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ruleset name="prezly-php-code-style">
3+
4+
<description>Prezly PHP Code Style preset</description>
5+
6+
<rule ref="PSR2">
7+
<exclude name="PSR2.Classes.ClassDeclaration.CloseBraceAfterBody"/>
8+
</rule>
9+
10+
<rule ref="Generic.CodeAnalysis.EmptyStatement">
11+
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCATCH"/>
12+
</rule>
13+
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
14+
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
15+
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
16+
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
17+
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
18+
19+
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
20+
21+
<rule ref="Generic.Files.ByteOrderMark"/>
22+
<rule ref="Generic.Files.LineEndings"/>
23+
<!--<rule ref="Generic.Files.LineLength">
24+
<properties>
25+
<property name="lineLimit" value="120"/>
26+
<property name="absoluteLineLimit" value="200"/>
27+
</properties>
28+
</rule>-->
29+
<rule ref="Generic.Files.LineLength">
30+
<exclude name="Generic.Files.LineLength.MaxExceeded"/>
31+
<exclude name="Generic.Files.LineLength.TooLong"/>
32+
</rule>
33+
<!--
34+
<rule ref="Generic.Files.LineLength.MaxExceeded">
35+
<message>Line contains %s chars, which is longer than the max limit of %s</message>
36+
<type>warning</type>
37+
</rule>
38+
<rule ref="Generic.Files.LineLength.TooLong">
39+
<message>Line longer than %s characters; contains %s characters</message>
40+
<type>warning</type>
41+
</rule> -->
42+
43+
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
44+
<rule ref="Generic.Formatting.SpaceAfterCast.NoSpace">
45+
<priority>warning</priority>
46+
</rule>
47+
48+
<rule ref="Generic.Functions.CallTimePassByReference"/>
49+
<rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
50+
51+
<rule ref="Generic.Metrics.NestingLevel">
52+
<properties>
53+
<property name="nestingLevel" value="7"/>
54+
</properties>
55+
</rule>
56+
<rule ref="Generic.Metrics.CyclomaticComplexity">
57+
<properties>
58+
<property name="complexity" value="20"/>
59+
<property name="absoluteComplexity" value="40"/>
60+
</properties>
61+
</rule>
62+
<rule ref="Generic.Metrics.CyclomaticComplexity.TooHigh">
63+
<type>warning</type>
64+
</rule>
65+
<rule ref="Generic.Metrics.CyclomaticComplexity.MaxExceeded">
66+
<type>warning</type>
67+
</rule>
68+
69+
<rule ref="Generic.NamingConventions.ConstructorName"/>
70+
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
71+
72+
<rule ref="Generic.PHP.DeprecatedFunctions"/>
73+
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
74+
<rule ref="Generic.PHP.ForbiddenFunctions"/>
75+
<rule ref="Generic.PHP.LowerCaseConstant"/>
76+
<rule ref="Generic.PHP.NoSilencedErrors"/>
77+
78+
<rule ref="Generic.Strings.UnnecessaryStringConcat"/>
79+
80+
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
81+
<rule ref="Generic.WhiteSpace.ScopeIndent"/>
82+
83+
<rule ref="Generic.Commenting.Todo.CommentFound">
84+
<message>Please review this TODO comment: %s</message>
85+
<type>warning</type>
86+
</rule>
87+
<rule ref="Generic.Commenting.Fixme.TaskFound">
88+
<message>Please review this FIXME comment: %s</message>
89+
<type>warning</type>
90+
</rule>
91+
92+
<rule ref="Generic.Classes.DuplicateClassName"/>
93+
94+
<rule ref="PEAR.Commenting.InlineComment"/>
95+
96+
<rule ref="PEAR.ControlStructures.MultiLineCondition"/>
97+
98+
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent"/>
99+
100+
<rule ref="MySource.PHP.EvalObjectFactory"/>
101+
<rule ref="MySource.PHP.GetRequestData"/>
102+
<!--
103+
<rule ref="MySource.PHP.ReturnFunctionValue"/>
104+
-->
105+
106+
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
107+
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
108+
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
109+
<type>warning</type>
110+
</rule>
111+
<rule ref="Squiz.WhiteSpace.CastSpacing"/>
112+
<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>
113+
<!--
114+
<rule ref="Squiz.WhiteSpace.MemberVarSpacing"/>
115+
-->
116+
<rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
117+
118+
<rule ref="Squiz.Scope.StaticThisUsage"/>
119+
120+
<rule ref="Squiz.Strings.ConcatenationSpacing">
121+
<properties>
122+
<property name="spacing" value="1"/>
123+
</properties>
124+
</rule>
125+
126+
</ruleset>

0 commit comments

Comments
 (0)