Skip to content

Commit 98b6689

Browse files
committed
Refactor to new library project.
1 parent 3284112 commit 98b6689

File tree

3 files changed

+95
-93
lines changed

3 files changed

+95
-93
lines changed

PSR2R/ruleset.xml

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<exclude-pattern>\.txt</exclude-pattern>
1818
<exclude-pattern>\.json</exclude-pattern>
1919

20-
<config name="installed_paths" value="../../slevomat/coding-standard,../../spryker/code-sniffer"/>
20+
<config name="installed_paths" value="../../slevomat/coding-standard,../../php-collective/code-sniffer"/>
2121

2222
<arg name="tab-width" value="4"/>
2323

@@ -61,8 +61,10 @@
6161
</properties>
6262
</rule>
6363

64-
<rule ref="Spryker.Commenting.DisallowArrayTypeHintSyntax"/>
65-
<rule ref="Spryker.Commenting.TypeHint"/>
64+
<!-- silenced due to issue
65+
<rule ref="SlevomatCodingStandard.Commenting.DisallowArrayTypeHintSyntax"/>
66+
-->
67+
<rule ref="PhpCollective.Commenting.TypeHint"/>
6668
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"/>
6769
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>
6870
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/>
@@ -112,49 +114,49 @@
112114
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison"/>
113115
<rule ref="SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing"/>
114116

115-
<rule ref="Spryker.Classes.MethodDeclaration"/>
116-
<rule ref="Spryker.Classes.MethodArgumentDefaultValue"/>
117-
<rule ref="Spryker.Classes.MethodTypeHint"/>
118-
<rule ref="Spryker.Classes.PropertyDefaultValue"/>
119-
<rule ref="Spryker.Classes.ReturnTypeHint"/>
120-
<rule ref="Spryker.Classes.SelfAccessor"/>
121-
<rule ref="Spryker.Classes.ClassFileName"/>
122-
123-
<rule ref="Spryker.Commenting.DocBlockConst"/>
124-
<rule ref="Spryker.Commenting.DocBlockConstructor"/>
125-
<rule ref="Spryker.Commenting.DocBlockReturnVoid"/>
126-
<rule ref="Spryker.Commenting.DocBlockNoInlineAlignment"/>
127-
<rule ref="Spryker.Commenting.DocBlockPipeSpacing"/>
128-
<rule ref="Spryker.Commenting.DocBlockReturnTag"/>
129-
<rule ref="Spryker.Commenting.DocBlockReturnVoid"/>
130-
<rule ref="Spryker.Commenting.DocBlockTagOrder"/>
131-
<rule ref="Spryker.Commenting.DocBlockTypeOrder"/>
132-
<rule ref="Spryker.Commenting.DocBlockVarNotJustNull"/>
133-
<rule ref="Spryker.Commenting.DocBlockVar"/>
134-
<rule ref="Spryker.Commenting.DocBlockStructure"/>
135-
<rule ref="Spryker.Commenting.DocBlockReturnNullableType"/>
136-
<rule ref="Spryker.Commenting.DocBlockReturnNull"/>
137-
<rule ref="Spryker.Commenting.DocBlockParamAllowDefaultValue"/>
138-
<rule ref="Spryker.Commenting.InlineDocBlock"/>
139-
<rule ref="Spryker.Commenting.Attributes"/>
140-
<rule ref="Spryker.Commenting.FullyQualifiedClassNameInDocBlock"/>
141-
142-
<rule ref="Spryker.ControlStructures.NoInlineAssignment"/>
143-
<rule ref="Spryker.ControlStructures.ConditionalExpressionOrder"/>
144-
145-
<rule ref="Spryker.Formatting.ArrayDeclaration"/>
146-
147-
<rule ref="Spryker.PHP.NoIsNull"/>
148-
<rule ref="Spryker.PHP.NotEqual"/>
149-
<rule ref="Spryker.PHP.ShortCast"/>
150-
<rule ref="Spryker.PHP.RemoveFunctionAlias"/>
151-
<rule ref="Spryker.PHP.PhpSapiConstant"/>
152-
<rule ref="Spryker.PHP.PreferCastOverFunction"/>
153-
154-
<rule ref="Spryker.WhiteSpace.ConcatenationSpacing"/>
155-
<rule ref="Spryker.WhiteSpace.ObjectAttributeSpacing"/>
156-
<rule ref="Spryker.WhiteSpace.CommaSpacing"/>
157-
<rule ref="Spryker.WhiteSpace.ImplicitCastSpacing"/>
117+
<rule ref="PhpCollective.Classes.MethodDeclaration"/>
118+
<rule ref="PhpCollective.Classes.MethodArgumentDefaultValue"/>
119+
<rule ref="PhpCollective.Classes.MethodTypeHint"/>
120+
<rule ref="PhpCollective.Classes.PropertyDefaultValue"/>
121+
<rule ref="PhpCollective.Classes.ReturnTypeHint"/>
122+
<rule ref="PhpCollective.Classes.SelfAccessor"/>
123+
<rule ref="PhpCollective.Classes.ClassFileName"/>
124+
125+
<rule ref="PhpCollective.Commenting.DocBlockConst"/>
126+
<rule ref="PhpCollective.Commenting.DocBlockConstructor"/>
127+
<rule ref="PhpCollective.Commenting.DocBlockReturnVoid"/>
128+
<rule ref="PhpCollective.Commenting.DocBlockNoInlineAlignment"/>
129+
<rule ref="PhpCollective.Commenting.DocBlockPipeSpacing"/>
130+
<rule ref="PhpCollective.Commenting.DocBlockReturnTag"/>
131+
<rule ref="PhpCollective.Commenting.DocBlockReturnVoid"/>
132+
<rule ref="PhpCollective.Commenting.DocBlockTagOrder"/>
133+
<rule ref="PhpCollective.Commenting.DocBlockTypeOrder"/>
134+
<rule ref="PhpCollective.Commenting.DocBlockVarNotJustNull"/>
135+
<rule ref="PhpCollective.Commenting.DocBlockVar"/>
136+
<rule ref="PhpCollective.Commenting.DocBlockStructure"/>
137+
<rule ref="PhpCollective.Commenting.DocBlockReturnNullableType"/>
138+
<rule ref="PhpCollective.Commenting.DocBlockReturnNull"/>
139+
<rule ref="PhpCollective.Commenting.DocBlockParamAllowDefaultValue"/>
140+
<rule ref="PhpCollective.Commenting.InlineDocBlock"/>
141+
<rule ref="PhpCollective.Commenting.Attributes"/>
142+
<rule ref="PhpCollective.Commenting.FullyQualifiedClassNameInDocBlock"/>
143+
144+
<rule ref="PhpCollective.ControlStructures.NoInlineAssignment"/>
145+
<rule ref="PhpCollective.ControlStructures.ConditionalExpressionOrder"/>
146+
147+
<rule ref="PhpCollective.Formatting.ArrayDeclaration"/>
148+
149+
<rule ref="PhpCollective.PHP.NoIsNull"/>
150+
<rule ref="PhpCollective.PHP.NotEqual"/>
151+
<rule ref="PhpCollective.PHP.ShortCast"/>
152+
<rule ref="PhpCollective.PHP.RemoveFunctionAlias"/>
153+
<rule ref="PhpCollective.PHP.PhpSapiConstant"/>
154+
<rule ref="PhpCollective.PHP.PreferCastOverFunction"/>
155+
156+
<rule ref="PhpCollective.WhiteSpace.ConcatenationSpacing"/>
157+
<rule ref="PhpCollective.WhiteSpace.ObjectAttributeSpacing"/>
158+
<rule ref="PhpCollective.WhiteSpace.CommaSpacing"/>
159+
<rule ref="PhpCollective.WhiteSpace.ImplicitCastSpacing"/>
158160

159161
<rule ref="SlevomatCodingStandard.Operators.SpreadOperatorSpacing"/>
160162

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
],
1414
"require": {
1515
"php": ">=7.3",
16-
"spryker/code-sniffer": "^0.17.1",
17-
"slevomat/coding-standard": "^7.2.0 || ^8.3.0",
16+
"php-collective/code-sniffer": "dev-master",
17+
"slevomat/coding-standard": "^8.3.0",
1818
"squizlabs/php_codesniffer": "^3.7.0"
1919
},
2020
"require-dev": {
@@ -31,6 +31,7 @@
3131
"PSR2R\\Tests\\": "tests/PSR2R/Tests/"
3232
}
3333
},
34+
"minimum-stability": "stable",
3435
"bin": [
3536
"bin/tokenize",
3637
"bin/sniff"
@@ -41,8 +42,8 @@
4142
"cs-check": "phpcs",
4243
"cs-fix": "phpcbf",
4344
"test": "php phpunit.phar",
44-
"test-setup": "[ ! -f phpunit.phar ] && wget https://phar.phpunit.de/phpunit-8.5.10.phar && mv phpunit-8.5.10.phar phpunit.phar || true",
45-
"test-setup-mac": "[ ! -f phpunit.phar ] && curl -OL https://phar.phpunit.de/phpunit-8.5.10.phar && mv phpunit-8.5.10.phar phpunit.phar || true",
45+
"test-setup": "[ ! -f phpunit.phar ] && wget https://phar.phpunit.de/phpunit-9.5.10.phar && mv phpunit-9.5.10.phar phpunit.phar || true",
46+
"test-setup-mac": "[ ! -f phpunit.phar ] && curl -OL https://phar.phpunit.de/phpunit-9.5.10.phar && mv phpunit-9.5.10.phar phpunit.phar || true",
4647
"test-coverage": "php phpunit.phar --log-junit tmp/coverage/unitreport.xml --coverage-html tmp/coverage --coverage-clover tmp/coverage/coverage.xml",
4748
"lowest": "validate-prefer-lowest",
4849
"lowest-setup": "composer update --prefer-lowest --prefer-stable --prefer-dist --no-interaction && cp composer.json composer.backup && composer require --dev dereuromark/composer-prefer-lowest && mv composer.backup composer.json",

docs/sniffs.md

Lines changed: 42 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PSR2R Code Sniffer
22

3-
The PSR2R standard contains 191 sniffs
3+
The PSR2R standard contains 190 sniffs
44

55
Generic (22 sniffs)
66
-------------------
@@ -105,6 +105,47 @@ PSR2R (44 sniffs)
105105
- PSR2R.WhiteSpace.TabIndent
106106
- PSR2R.WhiteSpace.UnaryOperatorSpacing
107107

108+
PhpCollective (38 sniffs)
109+
-------------------------
110+
- PhpCollective.Classes.ClassFileName
111+
- PhpCollective.Classes.MethodArgumentDefaultValue
112+
- PhpCollective.Classes.MethodDeclaration
113+
- PhpCollective.Classes.MethodTypeHint
114+
- PhpCollective.Classes.PropertyDefaultValue
115+
- PhpCollective.Classes.ReturnTypeHint
116+
- PhpCollective.Classes.SelfAccessor
117+
- PhpCollective.Commenting.Attributes
118+
- PhpCollective.Commenting.DocBlockConst
119+
- PhpCollective.Commenting.DocBlockConstructor
120+
- PhpCollective.Commenting.DocBlockNoInlineAlignment
121+
- PhpCollective.Commenting.DocBlockParamAllowDefaultValue
122+
- PhpCollective.Commenting.DocBlockPipeSpacing
123+
- PhpCollective.Commenting.DocBlockReturnNull
124+
- PhpCollective.Commenting.DocBlockReturnNullableType
125+
- PhpCollective.Commenting.DocBlockReturnTag
126+
- PhpCollective.Commenting.DocBlockReturnVoid
127+
- PhpCollective.Commenting.DocBlockStructure
128+
- PhpCollective.Commenting.DocBlockTagOrder
129+
- PhpCollective.Commenting.DocBlockTypeOrder
130+
- PhpCollective.Commenting.DocBlockVar
131+
- PhpCollective.Commenting.DocBlockVarNotJustNull
132+
- PhpCollective.Commenting.FullyQualifiedClassNameInDocBlock
133+
- PhpCollective.Commenting.InlineDocBlock
134+
- PhpCollective.Commenting.TypeHint
135+
- PhpCollective.ControlStructures.ConditionalExpressionOrder
136+
- PhpCollective.ControlStructures.NoInlineAssignment
137+
- PhpCollective.Formatting.ArrayDeclaration
138+
- PhpCollective.PHP.NoIsNull
139+
- PhpCollective.PHP.NotEqual
140+
- PhpCollective.PHP.PhpSapiConstant
141+
- PhpCollective.PHP.PreferCastOverFunction
142+
- PhpCollective.PHP.RemoveFunctionAlias
143+
- PhpCollective.PHP.ShortCast
144+
- PhpCollective.WhiteSpace.CommaSpacing
145+
- PhpCollective.WhiteSpace.ConcatenationSpacing
146+
- PhpCollective.WhiteSpace.ImplicitCastSpacing
147+
- PhpCollective.WhiteSpace.ObjectAttributeSpacing
148+
108149
SlevomatCodingStandard (45 sniffs)
109150
----------------------------------
110151
- SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation
@@ -153,48 +194,6 @@ SlevomatCodingStandard (45 sniffs)
153194
- SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable
154195
- SlevomatCodingStandard.Whitespaces.DuplicateSpaces
155196

156-
Spryker (39 sniffs)
157-
-------------------
158-
- Spryker.Classes.ClassFileName
159-
- Spryker.Classes.MethodArgumentDefaultValue
160-
- Spryker.Classes.MethodDeclaration
161-
- Spryker.Classes.MethodTypeHint
162-
- Spryker.Classes.PropertyDefaultValue
163-
- Spryker.Classes.ReturnTypeHint
164-
- Spryker.Classes.SelfAccessor
165-
- Spryker.Commenting.Attributes
166-
- Spryker.Commenting.DisallowArrayTypeHintSyntax
167-
- Spryker.Commenting.DocBlockConst
168-
- Spryker.Commenting.DocBlockConstructor
169-
- Spryker.Commenting.DocBlockNoInlineAlignment
170-
- Spryker.Commenting.DocBlockParamAllowDefaultValue
171-
- Spryker.Commenting.DocBlockPipeSpacing
172-
- Spryker.Commenting.DocBlockReturnNull
173-
- Spryker.Commenting.DocBlockReturnNullableType
174-
- Spryker.Commenting.DocBlockReturnTag
175-
- Spryker.Commenting.DocBlockReturnVoid
176-
- Spryker.Commenting.DocBlockStructure
177-
- Spryker.Commenting.DocBlockTagOrder
178-
- Spryker.Commenting.DocBlockTypeOrder
179-
- Spryker.Commenting.DocBlockVar
180-
- Spryker.Commenting.DocBlockVarNotJustNull
181-
- Spryker.Commenting.FullyQualifiedClassNameInDocBlock
182-
- Spryker.Commenting.InlineDocBlock
183-
- Spryker.Commenting.TypeHint
184-
- Spryker.ControlStructures.ConditionalExpressionOrder
185-
- Spryker.ControlStructures.NoInlineAssignment
186-
- Spryker.Formatting.ArrayDeclaration
187-
- Spryker.PHP.NoIsNull
188-
- Spryker.PHP.NotEqual
189-
- Spryker.PHP.PhpSapiConstant
190-
- Spryker.PHP.PreferCastOverFunction
191-
- Spryker.PHP.RemoveFunctionAlias
192-
- Spryker.PHP.ShortCast
193-
- Spryker.WhiteSpace.CommaSpacing
194-
- Spryker.WhiteSpace.ConcatenationSpacing
195-
- Spryker.WhiteSpace.ImplicitCastSpacing
196-
- Spryker.WhiteSpace.ObjectAttributeSpacing
197-
198197
Squiz (21 sniffs)
199198
-----------------
200199
- Squiz.Arrays.ArrayBracketSpacing

0 commit comments

Comments
 (0)