Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge branch '11.1.x' into 12.0.x #314

Merged
merged 7 commits into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
SHELL := /bin/bash

.PHONY: test test-report test-fix update-compatibility-patch

test: test-report test-fix
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.10.0",
"slevomat/coding-standard": "^8.11",
"squizlabs/php_codesniffer": "^3.7"
},
"config": {
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@
<rule ref="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming"/>
<!-- Forbid suffix "Trait" for traits -->
<rule ref="SlevomatCodingStandard.Classes.SuperfluousTraitNaming"/>
<!-- Forbid invalid annotation names in standard PHPDoc tags -->
<rule ref="SlevomatCodingStandard.Commenting.AnnotationName"/>
<!-- Require specific order of phpDoc annotations with empty newline between specific groups -->
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing">
<properties>
Expand Down
7 changes: 4 additions & 3 deletions tests/expected_report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -53,9 +54,9 @@ tests/input/use-ordering.php 1 0
tests/input/useless-semicolon.php 2 0
tests/input/UselessConditions.php 21 0
----------------------------------------------------------------------
A TOTAL OF 454 ERRORS AND 0 WARNINGS WERE FOUND IN 49 FILES
A TOTAL OF 462 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES
----------------------------------------------------------------------
PHPCBF CAN FIX 376 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
PHPCBF CAN FIX 378 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


29 changes: 29 additions & 0 deletions tests/fixed/annotation-name.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

interface Foo
{
/**
* This method does something
*/
public function doSomething(array $options): void;

/**
* This method does not perform any action
*/
public function nothing(): void;
}

final class Bar implements Foo
{
/** @inheritDoc */
public function doSomething(array $options): void
{
}

/** {@inheritDoc} */
public function nothing(): void
{
}
}
29 changes: 29 additions & 0 deletions tests/input/annotation-name.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

interface Foo
{
/**
* This method does something
*/
public function doSomething(array $options): void;

/**
* This method does not perform any action
*/
public function nothing(): void;
}

final class Bar implements Foo
{
/** @inheritdoc */
public function doSomething(array $options): void
{
}

/** {@inheritdoc} */
public function nothing(): void
{
}
}
16 changes: 6 additions & 10 deletions tests/php72-compatibility.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ diff --git a/tests/expected_report.txt b/tests/expected_report.txt
index d1e1fad..ea3b611 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
@@ -17,26 +17,23 @@
tests/input/ControlStructures.php 28 0
tests/input/doc-comment-spacing.php 11 0
tests/input/duplicate-assignment-variable.php 1 0
Expand Down Expand Up @@ -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
@@ -43,17 +42,16 @@ tests/input/strings.php 1 0
@@ -46,17 +43,16 @@
tests/input/superfluous-naming.php 11 0
tests/input/test-case.php 8 0
tests/input/trailing_comma_on_array.php 1 0
Expand All @@ -55,11 +51,11 @@ index d1e1fad..ea3b611 100644
-tests/input/UselessConditions.php 21 0
+tests/input/UselessConditions.php 20 0
----------------------------------------------------------------------
-A TOTAL OF 454 ERRORS AND 0 WARNINGS WERE FOUND IN 49 FILES
+A TOTAL OF 407 ERRORS AND 0 WARNINGS WERE FOUND IN 45 FILES
-A TOTAL OF 462 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES
+A TOTAL OF 415 ERRORS AND 2 WARNINGS WERE FOUND IN 46 FILES
----------------------------------------------------------------------
-PHPCBF CAN FIX 376 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
+PHPCBF CAN FIX 329 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
-PHPCBF CAN FIX 378 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
+PHPCBF CAN FIX 331 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


Expand Down
16 changes: 6 additions & 10 deletions tests/php73-compatibility.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ diff --git a/tests/expected_report.txt b/tests/expected_report.txt
index d1e1fad..9a78bc1 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
@@ -17,26 +17,23 @@
tests/input/ControlStructures.php 28 0
tests/input/doc-comment-spacing.php 11 0
tests/input/duplicate-assignment-variable.php 1 0
Expand Down Expand Up @@ -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
@@ -43,17 +42,17 @@ tests/input/strings.php 1 0
@@ -46,17 +43,17 @@
tests/input/superfluous-naming.php 11 0
tests/input/test-case.php 8 0
tests/input/trailing_comma_on_array.php 1 0
Expand All @@ -56,11 +52,11 @@ index d1e1fad..9a78bc1 100644
-tests/input/UselessConditions.php 21 0
+tests/input/UselessConditions.php 20 0
----------------------------------------------------------------------
-A TOTAL OF 454 ERRORS AND 0 WARNINGS WERE FOUND IN 49 FILES
+A TOTAL OF 409 ERRORS AND 0 WARNINGS WERE FOUND IN 46 FILES
-A TOTAL OF 462 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES
+A TOTAL OF 417 ERRORS AND 2 WARNINGS WERE FOUND IN 47 FILES
----------------------------------------------------------------------
-PHPCBF CAN FIX 376 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
+PHPCBF CAN FIX 331 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
-PHPCBF CAN FIX 378 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
+PHPCBF CAN FIX 333 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


Expand Down
16 changes: 6 additions & 10 deletions tests/php74-compatibility.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ diff --git a/tests/expected_report.txt b/tests/expected_report.txt
index d1e1fad..ed67841 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
@@ -17,26 +17,23 @@
tests/input/ControlStructures.php 28 0
tests/input/doc-comment-spacing.php 11 0
tests/input/duplicate-assignment-variable.php 1 0
Expand Down Expand Up @@ -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
@@ -43,17 +42,17 @@ tests/input/strings.php 1 0
@@ -46,17 +43,17 @@
tests/input/superfluous-naming.php 11 0
tests/input/test-case.php 8 0
tests/input/trailing_comma_on_array.php 1 0
Expand All @@ -54,11 +50,11 @@ index d1e1fad..ed67841 100644
-tests/input/UselessConditions.php 21 0
+tests/input/UselessConditions.php 20 0
----------------------------------------------------------------------
-A TOTAL OF 454 ERRORS AND 0 WARNINGS WERE FOUND IN 49 FILES
+A TOTAL OF 418 ERRORS AND 0 WARNINGS WERE FOUND IN 46 FILES
-A TOTAL OF 462 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES
+A TOTAL OF 426 ERRORS AND 2 WARNINGS WERE FOUND IN 47 FILES
----------------------------------------------------------------------
-PHPCBF CAN FIX 376 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
+PHPCBF CAN FIX 340 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
-PHPCBF CAN FIX 378 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
+PHPCBF CAN FIX 342 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


Expand Down
20 changes: 7 additions & 13 deletions tests/php80-compatibility.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,15 @@ diff --git a/tests/expected_report.txt b/tests/expected_report.txt
index d1e1fad..71022c4 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
@@ -19,7 +19,6 @@
tests/input/duplicate-assignment-variable.php 1 0
tests/input/EarlyReturn.php 7 0
tests/input/example-class.php 47 0
-tests/input/ExampleBackedEnum.php 3 0
tests/input/Exceptions.php 1 0
tests/input/forbidden-comments.php 14 0
tests/input/forbidden-functions.php 6 0
@@ -33,7 +32,7 @@ tests/input/null_coalesce_equal_operator.php 5 0
@@ -34,7 +33,7 @@
tests/input/null_coalesce_operator.php 3 0
tests/input/null_safe_operator.php 1 0
tests/input/optimized-functions.php 1 0
Expand All @@ -25,15 +19,15 @@ index d1e1fad..71022c4 100644
tests/input/return_type_on_closures.php 26 0
tests/input/return_type_on_methods.php 22 0
tests/input/semicolon_spacing.php 3 0
@@ -51,9 +52,9 @@ tests/input/use-ordering.php 1 0
@@ -54,9 +53,9 @@
tests/input/useless-semicolon.php 2 0
tests/input/UselessConditions.php 21 0
----------------------------------------------------------------------
-A TOTAL OF 454 ERRORS AND 0 WARNINGS WERE FOUND IN 49 FILES
+A TOTAL OF 448 ERRORS AND 0 WARNINGS WERE FOUND IN 48 FILES
-A TOTAL OF 462 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES
+A TOTAL OF 456 ERRORS AND 2 WARNINGS WERE FOUND IN 49 FILES
----------------------------------------------------------------------
-PHPCBF CAN FIX 376 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
+PHPCBF CAN FIX 370 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
-PHPCBF CAN FIX 378 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
+PHPCBF CAN FIX 372 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


Expand Down