Skip to content

Commit 1b2b7dc

Browse files
authored
Merge pull request #314 from phansys/merging_11
Merge branch '11.1.x' into 12.0.x
2 parents 0d82193 + 9604ecb commit 1b2b7dc

10 files changed

+92
-47
lines changed

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
SHELL := /bin/bash
2+
13
.PHONY: test test-report test-fix update-compatibility-patch
24

35
test: test-report test-fix

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"require": {
2525
"php": "^7.2 || ^8.0",
2626
"dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0.0",
27-
"slevomat/coding-standard": "^8.10.0",
27+
"slevomat/coding-standard": "^8.11",
2828
"squizlabs/php_codesniffer": "^3.7"
2929
},
3030
"config": {

lib/Doctrine/ruleset.xml

+2
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@
183183
<rule ref="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming"/>
184184
<!-- Forbid suffix "Trait" for traits -->
185185
<rule ref="SlevomatCodingStandard.Classes.SuperfluousTraitNaming"/>
186+
<!-- Forbid invalid annotation names in standard PHPDoc tags -->
187+
<rule ref="SlevomatCodingStandard.Commenting.AnnotationName"/>
186188
<!-- Require specific order of phpDoc annotations with empty newline between specific groups -->
187189
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing">
188190
<properties>

tests/expected_report.txt

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ PHP CODE SNIFFER REPORT SUMMARY
33
----------------------------------------------------------------------
44
FILE ERRORS WARNINGS
55
----------------------------------------------------------------------
6+
tests/input/annotation-name.php 8 0
67
tests/input/array_indentation.php 10 0
78
tests/input/arrow-functions-format.php 10 0
89
tests/input/assignment-operators.php 4 0
910
tests/input/attributes.php 15 0
1011
tests/input/binary_operators.php 9 0
11-
tests/input/class-references.php 10 0
12+
tests/input/class-references.php 10 2
1213
tests/input/ClassPropertySpacing.php 2 0
1314
tests/input/concatenation_spacing.php 49 0
1415
tests/input/constants-no-lsb.php 2 0
@@ -53,9 +54,9 @@ tests/input/use-ordering.php 1 0
5354
tests/input/useless-semicolon.php 2 0
5455
tests/input/UselessConditions.php 21 0
5556
----------------------------------------------------------------------
56-
A TOTAL OF 454 ERRORS AND 0 WARNINGS WERE FOUND IN 49 FILES
57+
A TOTAL OF 462 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES
5758
----------------------------------------------------------------------
58-
PHPCBF CAN FIX 376 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
59+
PHPCBF CAN FIX 378 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
5960
----------------------------------------------------------------------
6061

6162

tests/fixed/annotation-name.php

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
interface Foo
6+
{
7+
/**
8+
* This method does something
9+
*/
10+
public function doSomething(array $options): void;
11+
12+
/**
13+
* This method does not perform any action
14+
*/
15+
public function nothing(): void;
16+
}
17+
18+
final class Bar implements Foo
19+
{
20+
/** @inheritDoc */
21+
public function doSomething(array $options): void
22+
{
23+
}
24+
25+
/** {@inheritDoc} */
26+
public function nothing(): void
27+
{
28+
}
29+
}

tests/input/annotation-name.php

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
interface Foo
6+
{
7+
/**
8+
* This method does something
9+
*/
10+
public function doSomething(array $options): void;
11+
12+
/**
13+
* This method does not perform any action
14+
*/
15+
public function nothing(): void;
16+
}
17+
18+
final class Bar implements Foo
19+
{
20+
/** @inheritdoc */
21+
public function doSomething(array $options): void
22+
{
23+
}
24+
25+
/** {@inheritdoc} */
26+
public function nothing(): void
27+
{
28+
}
29+
}

tests/php72-compatibility.patch

+6-10
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ diff --git a/tests/expected_report.txt b/tests/expected_report.txt
22
index d1e1fad..ea3b611 100644
33
--- a/tests/expected_report.txt
44
+++ b/tests/expected_report.txt
5-
@@ -12,30 +12,27 @@ tests/input/class-references.php 10 0
6-
tests/input/ClassPropertySpacing.php 2 0
7-
tests/input/concatenation_spacing.php 49 0
8-
tests/input/constants-no-lsb.php 2 0
9-
tests/input/constants-var.php 6 0
5+
@@ -17,26 +17,23 @@
106
tests/input/ControlStructures.php 28 0
117
tests/input/doc-comment-spacing.php 11 0
128
tests/input/duplicate-assignment-variable.php 1 0
@@ -41,7 +37,7 @@ index d1e1fad..ea3b611 100644
4137
tests/input/semicolon_spacing.php 3 0
4238
tests/input/single-line-array-spacing.php 5 0
4339
tests/input/spread-operator.php 6 0
44-
@@ -43,17 +42,16 @@ tests/input/strings.php 1 0
40+
@@ -46,17 +43,16 @@
4541
tests/input/superfluous-naming.php 11 0
4642
tests/input/test-case.php 8 0
4743
tests/input/trailing_comma_on_array.php 1 0
@@ -55,11 +51,11 @@ index d1e1fad..ea3b611 100644
5551
-tests/input/UselessConditions.php 21 0
5652
+tests/input/UselessConditions.php 20 0
5753
----------------------------------------------------------------------
58-
-A TOTAL OF 454 ERRORS AND 0 WARNINGS WERE FOUND IN 49 FILES
59-
+A TOTAL OF 407 ERRORS AND 0 WARNINGS WERE FOUND IN 45 FILES
54+
-A TOTAL OF 462 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES
55+
+A TOTAL OF 415 ERRORS AND 2 WARNINGS WERE FOUND IN 46 FILES
6056
----------------------------------------------------------------------
61-
-PHPCBF CAN FIX 376 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
62-
+PHPCBF CAN FIX 329 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
57+
-PHPCBF CAN FIX 378 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
58+
+PHPCBF CAN FIX 331 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
6359
----------------------------------------------------------------------
6460

6561

tests/php73-compatibility.patch

+6-10
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ diff --git a/tests/expected_report.txt b/tests/expected_report.txt
22
index d1e1fad..9a78bc1 100644
33
--- a/tests/expected_report.txt
44
+++ b/tests/expected_report.txt
5-
@@ -12,30 +12,27 @@ tests/input/class-references.php 10 0
6-
tests/input/ClassPropertySpacing.php 2 0
7-
tests/input/concatenation_spacing.php 49 0
8-
tests/input/constants-no-lsb.php 2 0
9-
tests/input/constants-var.php 6 0
5+
@@ -17,26 +17,23 @@
106
tests/input/ControlStructures.php 28 0
117
tests/input/doc-comment-spacing.php 11 0
128
tests/input/duplicate-assignment-variable.php 1 0
@@ -41,7 +37,7 @@ index d1e1fad..9a78bc1 100644
4137
tests/input/semicolon_spacing.php 3 0
4238
tests/input/single-line-array-spacing.php 5 0
4339
tests/input/spread-operator.php 6 0
44-
@@ -43,17 +42,17 @@ tests/input/strings.php 1 0
40+
@@ -46,17 +43,17 @@
4541
tests/input/superfluous-naming.php 11 0
4642
tests/input/test-case.php 8 0
4743
tests/input/trailing_comma_on_array.php 1 0
@@ -56,11 +52,11 @@ index d1e1fad..9a78bc1 100644
5652
-tests/input/UselessConditions.php 21 0
5753
+tests/input/UselessConditions.php 20 0
5854
----------------------------------------------------------------------
59-
-A TOTAL OF 454 ERRORS AND 0 WARNINGS WERE FOUND IN 49 FILES
60-
+A TOTAL OF 409 ERRORS AND 0 WARNINGS WERE FOUND IN 46 FILES
55+
-A TOTAL OF 462 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES
56+
+A TOTAL OF 417 ERRORS AND 2 WARNINGS WERE FOUND IN 47 FILES
6157
----------------------------------------------------------------------
62-
-PHPCBF CAN FIX 376 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
63-
+PHPCBF CAN FIX 331 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
58+
-PHPCBF CAN FIX 378 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
59+
+PHPCBF CAN FIX 333 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
6460
----------------------------------------------------------------------
6561

6662

tests/php74-compatibility.patch

+6-10
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ diff --git a/tests/expected_report.txt b/tests/expected_report.txt
22
index d1e1fad..ed67841 100644
33
--- a/tests/expected_report.txt
44
+++ b/tests/expected_report.txt
5-
@@ -12,30 +12,27 @@ tests/input/class-references.php 10 0
6-
tests/input/ClassPropertySpacing.php 2 0
7-
tests/input/concatenation_spacing.php 49 0
8-
tests/input/constants-no-lsb.php 2 0
9-
tests/input/constants-var.php 6 0
5+
@@ -17,26 +17,23 @@
106
tests/input/ControlStructures.php 28 0
117
tests/input/doc-comment-spacing.php 11 0
128
tests/input/duplicate-assignment-variable.php 1 0
@@ -39,7 +35,7 @@ index d1e1fad..ed67841 100644
3935
tests/input/semicolon_spacing.php 3 0
4036
tests/input/single-line-array-spacing.php 5 0
4137
tests/input/spread-operator.php 6 0
42-
@@ -43,17 +42,17 @@ tests/input/strings.php 1 0
38+
@@ -46,17 +43,17 @@
4339
tests/input/superfluous-naming.php 11 0
4440
tests/input/test-case.php 8 0
4541
tests/input/trailing_comma_on_array.php 1 0
@@ -54,11 +50,11 @@ index d1e1fad..ed67841 100644
5450
-tests/input/UselessConditions.php 21 0
5551
+tests/input/UselessConditions.php 20 0
5652
----------------------------------------------------------------------
57-
-A TOTAL OF 454 ERRORS AND 0 WARNINGS WERE FOUND IN 49 FILES
58-
+A TOTAL OF 418 ERRORS AND 0 WARNINGS WERE FOUND IN 46 FILES
53+
-A TOTAL OF 462 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES
54+
+A TOTAL OF 426 ERRORS AND 2 WARNINGS WERE FOUND IN 47 FILES
5955
----------------------------------------------------------------------
60-
-PHPCBF CAN FIX 376 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
61-
+PHPCBF CAN FIX 340 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
56+
-PHPCBF CAN FIX 378 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
57+
+PHPCBF CAN FIX 342 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
6258
----------------------------------------------------------------------
6359

6460

tests/php80-compatibility.patch

+7-13
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,15 @@ diff --git a/tests/expected_report.txt b/tests/expected_report.txt
22
index d1e1fad..71022c4 100644
33
--- a/tests/expected_report.txt
44
+++ b/tests/expected_report.txt
5-
@@ -12,13 +12,12 @@ tests/input/class-references.php 10 0
6-
tests/input/ClassPropertySpacing.php 2 0
7-
tests/input/concatenation_spacing.php 49 0
8-
tests/input/constants-no-lsb.php 2 0
9-
tests/input/constants-var.php 6 0
10-
tests/input/ControlStructures.php 28 0
11-
tests/input/doc-comment-spacing.php 11 0
5+
@@ -19,7 +19,6 @@
126
tests/input/duplicate-assignment-variable.php 1 0
137
tests/input/EarlyReturn.php 7 0
148
tests/input/example-class.php 47 0
159
-tests/input/ExampleBackedEnum.php 3 0
1610
tests/input/Exceptions.php 1 0
1711
tests/input/forbidden-comments.php 14 0
1812
tests/input/forbidden-functions.php 6 0
19-
@@ -33,7 +32,7 @@ tests/input/null_coalesce_equal_operator.php 5 0
13+
@@ -34,7 +33,7 @@
2014
tests/input/null_coalesce_operator.php 3 0
2115
tests/input/null_safe_operator.php 1 0
2216
tests/input/optimized-functions.php 1 0
@@ -25,15 +19,15 @@ index d1e1fad..71022c4 100644
2519
tests/input/return_type_on_closures.php 26 0
2620
tests/input/return_type_on_methods.php 22 0
2721
tests/input/semicolon_spacing.php 3 0
28-
@@ -51,9 +52,9 @@ tests/input/use-ordering.php 1 0
22+
@@ -54,9 +53,9 @@
2923
tests/input/useless-semicolon.php 2 0
3024
tests/input/UselessConditions.php 21 0
3125
----------------------------------------------------------------------
32-
-A TOTAL OF 454 ERRORS AND 0 WARNINGS WERE FOUND IN 49 FILES
33-
+A TOTAL OF 448 ERRORS AND 0 WARNINGS WERE FOUND IN 48 FILES
26+
-A TOTAL OF 462 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES
27+
+A TOTAL OF 456 ERRORS AND 2 WARNINGS WERE FOUND IN 49 FILES
3428
----------------------------------------------------------------------
35-
-PHPCBF CAN FIX 376 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
36-
+PHPCBF CAN FIX 370 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
29+
-PHPCBF CAN FIX 378 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
30+
+PHPCBF CAN FIX 372 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
3731
----------------------------------------------------------------------
3832

3933

0 commit comments

Comments
 (0)