Skip to content

Commit 45d6c95

Browse files
committed
Update cs rules
1 parent f5127bf commit 45d6c95

File tree

2 files changed

+111
-3
lines changed

2 files changed

+111
-3
lines changed

composer.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"issues": "https://github.com/Spameri/ElasticQuery/issues"
1212
},
1313
"require": {
14-
"php": ">=7.4",
14+
"php": ">=8.2",
1515
"ext-json": "*"
1616
},
1717
"require-dev": {
@@ -20,7 +20,7 @@
2020
"nette/tester": "v2.3.1",
2121
"elasticsearch/elasticsearch": "^7",
2222
"guzzlehttp/guzzle": "^6.3",
23-
"spameri/coding-standard": "@dev"
23+
"slevomat/coding-standard": "^8.0"
2424
},
2525
"autoload": {
2626
"psr-4": {
@@ -31,5 +31,10 @@
3131
"psr-4": {
3232
"SpameriTests\\": "tests/SpameriTests"
3333
}
34+
},
35+
"config": {
36+
"allow-plugins": {
37+
"dealerdirect/phpcodesniffer-composer-installer": true
38+
}
3439
}
3540
}

ruleset.xml

Lines changed: 104 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,104 @@
11
<?xml version="1.0" ?>
22
<ruleset name="Spameri\ElasticQuery">
3-
<rule ref="./vendor/spameri/coding-standard/src/ruleset.xml"/>
3+
4+
<config name="installed_paths" value="../../slevomat/coding-standard,../../escapestudios/symfony2-coding-standard"/>
5+
6+
<!-- Arrays -->
7+
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma"/>
8+
9+
<!-- Classes -->
10+
<rule ref="Generic.Classes.DuplicateClassName"/>
11+
<rule ref="Squiz.Classes.LowercaseClassKeywords"/>
12+
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility"/>
13+
<!-- <rule ref="SlevomatCodingStandard.Classes.UnusedPrivateElements"/>-->
14+
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference"/>
15+
16+
<!-- Exceptions -->
17+
<rule ref="SlevomatCodingStandard.Exceptions.DeadCatch"/>
18+
<rule ref="SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly"/>
19+
20+
<!-- Files -->
21+
<rule ref="Generic.Files.ByteOrderMark"/>
22+
<rule ref="Generic.Files.LineEndings"/>
23+
<rule ref="PSR2.Files.EndFileNewline"/>
24+
<rule ref="Zend.Files.ClosingTag"/>
25+
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
26+
<properties>
27+
<property name="rootNamespaces" type="array">
28+
<element key="src" value="Spameri\Elastic"/>
29+
<element key="tests/SpameriTests" value="SpameriTests"/>
30+
</property>
31+
</properties>
32+
</rule>
33+
34+
<!-- Functions -->
35+
<rule ref="Squiz.Functions.LowercaseFunctionKeywords"/>
36+
<rule ref="SlevomatCodingStandard.Functions.StaticClosure"/>
37+
<rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure"/>
38+
<rule ref="SlevomatCodingStandard.Functions.UnusedParameter"/>
39+
40+
<!-- Namespaces -->
41+
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
42+
<properties>
43+
<property name="searchAnnotations" value="1"/>
44+
</properties>
45+
</rule>
46+
<rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace"/>
47+
<rule ref="SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces"/>
48+
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants"/>
49+
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions"/>
50+
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions"/>
51+
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation"/>
52+
53+
<!-- NamingConventions -->
54+
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
55+
<rule ref="Generic.NamingConventions.CamelCapsFunctionName">
56+
<properties>
57+
<property name="strict" value="0"/>
58+
</properties>
59+
</rule>
60+
61+
<!-- PHP -->
62+
<rule ref="Generic.PHP.DeprecatedFunctions"/>
63+
<rule ref="Generic.PHP.ForbiddenFunctions"/>
64+
<rule ref="Generic.PHP.UpperCaseConstant"/>
65+
<rule ref="SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking"/>
66+
67+
<!-- NewLines -->
68+
<!-- <rule ref="Symfony.Formatting.BlankLineBeforeReturn"/>-->
69+
70+
<!-- WhiteSpace -->
71+
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
72+
<rule ref="Squiz.ControlStructures.ControlSignature"/>
73+
<rule ref="Generic.Formatting.SpaceAfterCast"/>
74+
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>
75+
76+
<!-- Control structures -->
77+
<rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition"/>
78+
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison"/>
79+
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowEmpty"/>
80+
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"/>
81+
82+
83+
<!-- TypeHints -->
84+
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
85+
<exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.IncorrectWhitespaceBetweenOpenTagAndDeclare"/>
86+
</rule>
87+
<rule ref="SlevomatCodingStandard.TypeHints.DisallowArrayTypeHintSyntax"/>
88+
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing" />
89+
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>
90+
91+
<!-- Operators -->
92+
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators"/>
93+
<rule ref="SlevomatCodingStandard.Operators.RequireCombinedAssignmentOperator"/>
94+
95+
<!-- Variables -->
96+
<rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable"/>
97+
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable"/>
98+
<rule ref="SlevomatCodingStandard.Variables.UselessVariable"/>
99+
100+
<!-- Commenting -->
101+
<rule ref="SlevomatCodingStandard.Commenting.DisallowOneLinePropertyDocComment"/>
4102

5103
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
6104
<properties>
@@ -11,4 +109,9 @@
11109
</properties>
12110
</rule>
13111

112+
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma"/>
113+
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall"/>
114+
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInClosureUse"/>
115+
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration"/>
116+
14117
</ruleset>

0 commit comments

Comments
 (0)