From fae6351e01c30d6932d9c91a2a40a5fd3c485757 Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Fri, 21 Apr 2023 21:55:07 -0300 Subject: [PATCH 1/3] Bump "slevomat/coding-standard" to ^8.11 --- composer.json | 2 +- tests/php72-compatibility.patch | 10 +++------- tests/php73-compatibility.patch | 10 +++------- tests/php74-compatibility.patch | 10 +++------- tests/php80-compatibility.patch | 10 ++-------- 5 files changed, 12 insertions(+), 30 deletions(-) diff --git a/composer.json b/composer.json index e0082438..a2d6443a 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "require": { "php": "^7.2 || ^8.0", "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0.0", - "slevomat/coding-standard": "^8.6.2", + "slevomat/coding-standard": "^8.11", "squizlabs/php_codesniffer": "^3.7" }, "config": { diff --git a/tests/php72-compatibility.patch b/tests/php72-compatibility.patch index c9767ac2..d4846cb3 100644 --- a/tests/php72-compatibility.patch +++ b/tests/php72-compatibility.patch @@ -1,12 +1,8 @@ diff --git a/tests/expected_report.txt b/tests/expected_report.txt -index d1e1fad..ea3b611 100644 +index 1773423..f6e6841 100644 --- a/tests/expected_report.txt +++ b/tests/expected_report.txt -@@ -12,30 +12,27 @@ tests/input/class-references.php 10 0 - tests/input/ClassPropertySpacing.php 2 0 - tests/input/concatenation_spacing.php 49 0 - tests/input/constants-no-lsb.php 2 0 - tests/input/constants-var.php 6 0 +@@ -16,26 +16,23 @@ tests/input/constants-var.php 6 0 tests/input/ControlStructures.php 28 0 tests/input/doc-comment-spacing.php 11 0 tests/input/duplicate-assignment-variable.php 1 0 @@ -41,7 +37,7 @@ index d1e1fad..ea3b611 100644 tests/input/semicolon_spacing.php 3 0 tests/input/single-line-array-spacing.php 5 0 tests/input/spread-operator.php 6 0 -@@ -44,17 +41,16 @@ tests/input/strings.php 1 0 +@@ -44,17 +41,16 @@ tests/input/strings.php 3 0 tests/input/superfluous-naming.php 11 0 tests/input/test-case.php 8 0 tests/input/trailing_comma_on_array.php 1 0 diff --git a/tests/php73-compatibility.patch b/tests/php73-compatibility.patch index b98e0ad1..4a22e06a 100644 --- a/tests/php73-compatibility.patch +++ b/tests/php73-compatibility.patch @@ -1,12 +1,8 @@ diff --git a/tests/expected_report.txt b/tests/expected_report.txt -index d1e1fad..9a78bc1 100644 +index 1773423..0ea80d5 100644 --- a/tests/expected_report.txt +++ b/tests/expected_report.txt -@@ -12,30 +12,27 @@ tests/input/class-references.php 10 0 - tests/input/ClassPropertySpacing.php 2 0 - tests/input/concatenation_spacing.php 49 0 - tests/input/constants-no-lsb.php 2 0 - tests/input/constants-var.php 6 0 +@@ -16,26 +16,23 @@ tests/input/constants-var.php 6 0 tests/input/ControlStructures.php 28 0 tests/input/doc-comment-spacing.php 11 0 tests/input/duplicate-assignment-variable.php 1 0 @@ -41,7 +37,7 @@ index d1e1fad..9a78bc1 100644 tests/input/semicolon_spacing.php 3 0 tests/input/single-line-array-spacing.php 5 0 tests/input/spread-operator.php 6 0 -@@ -44,17 +41,17 @@ tests/input/strings.php 1 0 +@@ -44,17 +41,17 @@ tests/input/strings.php 3 0 tests/input/superfluous-naming.php 11 0 tests/input/test-case.php 8 0 tests/input/trailing_comma_on_array.php 1 0 diff --git a/tests/php74-compatibility.patch b/tests/php74-compatibility.patch index c3d3cccf..aff46630 100644 --- a/tests/php74-compatibility.patch +++ b/tests/php74-compatibility.patch @@ -1,12 +1,8 @@ diff --git a/tests/expected_report.txt b/tests/expected_report.txt -index d1e1fad..ed67841 100644 +index 1773423..9422a54 100644 --- a/tests/expected_report.txt +++ b/tests/expected_report.txt -@@ -12,30 +12,27 @@ tests/input/class-references.php 10 0 - tests/input/ClassPropertySpacing.php 2 0 - tests/input/concatenation_spacing.php 49 0 - tests/input/constants-no-lsb.php 2 0 - tests/input/constants-var.php 6 0 +@@ -16,26 +16,23 @@ tests/input/constants-var.php 6 0 tests/input/ControlStructures.php 28 0 tests/input/doc-comment-spacing.php 11 0 tests/input/duplicate-assignment-variable.php 1 0 @@ -39,7 +35,7 @@ index d1e1fad..ed67841 100644 tests/input/semicolon_spacing.php 3 0 tests/input/single-line-array-spacing.php 5 0 tests/input/spread-operator.php 6 0 -@@ -44,17 +41,17 @@ tests/input/strings.php 1 0 +@@ -44,17 +41,17 @@ tests/input/strings.php 3 0 tests/input/superfluous-naming.php 11 0 tests/input/test-case.php 8 0 tests/input/trailing_comma_on_array.php 1 0 diff --git a/tests/php80-compatibility.patch b/tests/php80-compatibility.patch index 9321f053..6fb3f584 100644 --- a/tests/php80-compatibility.patch +++ b/tests/php80-compatibility.patch @@ -1,14 +1,8 @@ diff --git a/tests/expected_report.txt b/tests/expected_report.txt -index d1e1fad..71022c4 100644 +index 1773423..449da88 100644 --- a/tests/expected_report.txt +++ b/tests/expected_report.txt -@@ -12,13 +12,12 @@ tests/input/class-references.php 10 0 - tests/input/ClassPropertySpacing.php 2 0 - tests/input/concatenation_spacing.php 49 0 - tests/input/constants-no-lsb.php 2 0 - tests/input/constants-var.php 6 0 - tests/input/ControlStructures.php 28 0 - tests/input/doc-comment-spacing.php 11 0 +@@ -18,7 +18,6 @@ tests/input/doc-comment-spacing.php 11 0 tests/input/duplicate-assignment-variable.php 1 0 tests/input/EarlyReturn.php 7 0 tests/input/example-class.php 47 0 From 94079fdb88ce6975834647104e0b7670066bdfe5 Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Sat, 22 Apr 2023 06:17:15 -0300 Subject: [PATCH 2/3] Set Bash explicitly as default shell in `Makefile` --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 80eb9081..43a08501 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +SHELL := /bin/bash + .PHONY: test test-report test-fix update-compatibility-patch test: test-report test-fix From 4b26a2ea4f81baa1a55e8714a18976656892f70d Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Sun, 23 Apr 2023 15:42:48 -0300 Subject: [PATCH 3/3] Configure "SlevomatCodingStandard.Commenting.AnnotationName" rule --- lib/Doctrine/ruleset.xml | 2 ++ tests/expected_report.txt | 7 ++++--- tests/fixed/annotation-name.php | 29 +++++++++++++++++++++++++++++ tests/input/annotation-name.php | 29 +++++++++++++++++++++++++++++ tests/php72-compatibility.patch | 12 ++++++------ tests/php73-compatibility.patch | 12 ++++++------ tests/php74-compatibility.patch | 12 ++++++------ tests/php80-compatibility.patch | 14 +++++++------- 8 files changed, 89 insertions(+), 28 deletions(-) create mode 100644 tests/fixed/annotation-name.php create mode 100644 tests/input/annotation-name.php diff --git a/lib/Doctrine/ruleset.xml b/lib/Doctrine/ruleset.xml index ed99bc4e..6a8f667d 100644 --- a/lib/Doctrine/ruleset.xml +++ b/lib/Doctrine/ruleset.xml @@ -181,6 +181,8 @@ + + diff --git a/tests/expected_report.txt b/tests/expected_report.txt index 17734237..814a2c3e 100644 --- a/tests/expected_report.txt +++ b/tests/expected_report.txt @@ -3,12 +3,13 @@ PHP CODE SNIFFER REPORT SUMMARY ---------------------------------------------------------------------- FILE ERRORS WARNINGS ---------------------------------------------------------------------- +tests/input/annotation-name.php 8 0 tests/input/array_indentation.php 10 0 tests/input/arrow-functions-format.php 10 0 tests/input/assignment-operators.php 4 0 tests/input/attributes.php 15 0 tests/input/binary_operators.php 9 0 -tests/input/class-references.php 10 0 +tests/input/class-references.php 10 2 tests/input/ClassPropertySpacing.php 2 0 tests/input/concatenation_spacing.php 49 0 tests/input/constants-no-lsb.php 2 0 @@ -52,9 +53,9 @@ tests/input/use-ordering.php 1 0 tests/input/useless-semicolon.php 2 0 tests/input/UselessConditions.php 21 0 ---------------------------------------------------------------------- -A TOTAL OF 453 ERRORS AND 0 WARNINGS WERE FOUND IN 48 FILES +A TOTAL OF 461 ERRORS AND 2 WARNINGS WERE FOUND IN 49 FILES ---------------------------------------------------------------------- -PHPCBF CAN FIX 375 OF THESE SNIFF VIOLATIONS AUTOMATICALLY +PHPCBF CAN FIX 377 OF THESE SNIFF VIOLATIONS AUTOMATICALLY ---------------------------------------------------------------------- diff --git a/tests/fixed/annotation-name.php b/tests/fixed/annotation-name.php new file mode 100644 index 00000000..6596c306 --- /dev/null +++ b/tests/fixed/annotation-name.php @@ -0,0 +1,29 @@ +