Skip to content

Commit b25acd9

Browse files
committed
Update the coding standard by using the one of phpMyAdmin 6.x as a template
1 parent d494086 commit b25acd9

2 files changed

Lines changed: 43 additions & 36 deletions

File tree

phpcs.xml.dist

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,57 +22,64 @@
2222
<exclude name="SlevomatCodingStandard.Commenting.ForbiddenAnnotations.AnnotationForbidden"/>
2323
<exclude name="SlevomatCodingStandard.Commenting.DocCommentSpacing.IncorrectAnnotationsGroup"/>
2424
<exclude name="SlevomatCodingStandard.Commenting.DocCommentSpacing.IncorrectOrderOfAnnotationsGroup"/>
25-
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableParameterTypeHintSpecification"/>
26-
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversablePropertyTypeHintSpecification"/>
27-
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableReturnTypeHintSpecification"/>
28-
<exclude name="Generic.Files.LineLength.TooLong"/>
25+
<exclude name="Generic.Files.InlineHTML.Found"/>
26+
<exclude name="Generic.PHP.CharacterBeforePHPOpeningTag.Found"/>
2927
<exclude name="Squiz.Arrays.ArrayDeclaration.KeySpecified"/>
3028
<exclude name="Squiz.Arrays.ArrayDeclaration.NoKeySpecified"/>
31-
<exclude name="Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps"/>
32-
<exclude name="Squiz.NamingConventions.ValidVariableName.NotCamelCaps"/>
33-
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification"/>
34-
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification"/>
35-
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification"/>
36-
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint"/>
37-
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint"/>
3829
</rule>
3930

40-
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
41-
<exclude-pattern>*/src/Controller/*</exclude-pattern>
31+
<rule ref="SlevomatCodingStandard.Functions.RequireSingleLineCall"/>
32+
<rule ref="SlevomatCodingStandard.Whitespaces.DuplicateSpaces">
33+
<properties>
34+
<property name="ignoreSpacesInComment" value="true"/>
35+
</properties>
4236
</rule>
4337

44-
<rule ref="Generic.Files.InlineHTML.Found">
45-
<exclude-pattern>*/templates/*</exclude-pattern>
38+
<rule ref="Squiz.Classes.ClassFileName.NoMatch">
39+
<exclude-pattern>*/config/Migrations/*</exclude-pattern>
4640
</rule>
4741

48-
<rule ref="Generic.PHP.CharacterBeforePHPOpeningTag.Found">
49-
<exclude-pattern>*/templates/*</exclude-pattern>
42+
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
43+
<exclude-pattern>*/config/Migrations/*</exclude-pattern>
5044
</rule>
5145

52-
<rule ref="Generic.PHP.DisallowShortOpenTag.EchoFound">
53-
<exclude-pattern>*/templates/*</exclude-pattern>
46+
<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
47+
<exclude-pattern>*/config/Migrations/*</exclude-pattern>
5448
</rule>
5549

56-
<rule ref="Squiz.NamingConventions.ValidVariableName.StringNotCamelCaps">
57-
<exclude-pattern>*/templates/*</exclude-pattern>
50+
<!-- Rules that should be followed, but are not required -->
51+
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
52+
<severity>4</severity>
53+
</rule>
54+
<rule ref="Squiz.NamingConventions.ValidVariableName.NotCamelCaps">
55+
<severity>4</severity>
5856
</rule>
59-
6057
<rule ref="Squiz.Arrays.ArrayDeclaration.MultiLineNotAllowed">
61-
<exclude-pattern>*/config/*</exclude-pattern>
58+
<severity>4</severity>
6259
</rule>
63-
64-
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
65-
<exclude-pattern>*/config/Migrations/*</exclude-pattern>
60+
<rule ref="Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps">
61+
<severity>4</severity>
6662
</rule>
67-
<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
68-
<exclude-pattern>*/config/Migrations/*</exclude-pattern>
69-
<exclude-pattern>*/tests/*</exclude-pattern>
63+
<rule ref="SlevomatCodingStandard.Functions.RequireSingleLineCall.RequiredSingleLineCall">
64+
<severity>4</severity>
7065
</rule>
71-
<rule ref="Squiz.Classes.ClassFileName.NoMatch">
72-
<exclude-pattern>*/config/Migrations/*</exclude-pattern>
66+
<rule ref="Generic.Files.LineLength.TooLong">
67+
<severity>4</severity>
7368
</rule>
74-
<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
75-
<exclude-pattern>*/config/Migrations/*</exclude-pattern>
69+
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification">
70+
<severity>4</severity>
71+
</rule>
72+
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification">
73+
<severity>4</severity>
74+
</rule>
75+
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification">
76+
<severity>4</severity>
77+
</rule>
78+
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint">
79+
<severity>4</severity>
80+
</rule>
81+
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint">
82+
<severity>4</severity>
7683
</rule>
7784

7885
</ruleset>

src/Model/Table/IncidentsTable.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public function createIncidentFromBugReport(?array $bugReport): array
191191
];
192192
}
193193

194-
$incident_ids = []; // array to hold ids of all the inserted incidents
194+
$incident_ids = []; // array to hold ids of all the inserted incidents
195195
$new_report_ids = []; // array to hold ids of all newly created reports
196196

197197
// Avoid storing too many errors from single report
@@ -387,7 +387,7 @@ protected function getSchematizedIncidents(array $bugReport): array
387387
'script_name' => $error['file'],
388388
'stacktrace' => json_encode($error['stackTrace'] ?? []),
389389
'stackhash' => $error['stackhash'],
390-
'exception_type' => 1, // 'php'
390+
'exception_type' => 1, // 'php'
391391
]
392392
);
393393
array_push($schematizedReports, $tmpReport);
@@ -406,7 +406,7 @@ protected function getSchematizedIncidents(array $bugReport): array
406406
'script_name' => $bugReport['script_name'] ?? '',
407407
'stacktrace' => json_encode($exception['stack'] ?? []),
408408
'stackhash' => self::getStackHash($exception['stack'] ?? []),
409-
'exception_type' => 0, //'js'
409+
'exception_type' => 0, //'js'
410410
]
411411
);
412412

0 commit comments

Comments
 (0)