Skip to content

Commit 141db49

Browse files
committed
Merge remote-tracking branch 'upstream/9.0.x' into merge
# Conflicts: # Makefile # tests/php74-compatibility.patch # tests/php80-compatibility.patch
2 parents ace09e8 + 094a121 commit 141db49

File tree

10 files changed

+403
-28
lines changed

10 files changed

+403
-28
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,11 @@ jobs:
9090
strategy:
9191
matrix:
9292
php-version:
93-
- "7.1"
9493
- "7.2"
9594
- "7.3"
9695
- "7.4"
96+
- "8.0"
97+
- "8.1"
9798

9899
steps:
99100
- name: "Checkout"
@@ -126,9 +127,10 @@ jobs:
126127
strategy:
127128
matrix:
128129
php-version:
129-
- "7.1"
130+
- "7.2"
130131
- "7.4"
131132
- "8.0"
133+
- "8.1"
132134

133135
steps:
134136
- name: "Checkout"

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,16 @@ update-compatibility-patch-80:
2828
@git apply tests/php80-compatibility.patch
2929
@printf "Please open your editor and apply your changes\n"
3030
@until [ "$${compatibility_resolved}" == "y" ]; do read -p "Have finished your changes (y|n)? " compatibility_resolved; done && compatibility_resolved=
31-
@git diff -- tests/expected_report.txt tests/fixed tests/input > .tmp-patch-80 && mv .tmp-patch-80 tests/php80-compatibility.patch && git apply -R tests/php80-compatibility.patch
31+
@git diff -- tests/expected_report.txt tests/fixed tests/input > .tmp-patch && mv .tmp-patch tests/php80-compatibility.patch && git apply -R tests/php80-compatibility.patch
3232
@git commit -m 'Update compatibility patch' tests/php80-compatibility.patch
3333

34+
update-compatibility-patch-81:
35+
@git apply tests/php81-compatibility.patch
36+
@printf "Please open your editor and apply your changes\n"
37+
@until [ "$${compatibility_resolved}" == "y" ]; do read -p "Have finished your changes (y|n)? " compatibility_resolved; done && compatibility_resolved=
38+
@git diff -- tests/expected_report.txt tests/fixed tests/input > .tmp-patch && mv .tmp-patch tests/php81-compatibility.patch && git apply -R tests/php81-compatibility.patch
39+
@git commit -m 'Update compatibility patch' tests/php81-compatibility.patch
40+
3441
vendor: composer.json
3542
composer update
3643
touch -c vendor

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
{"name": "Steve Müller", "email": "[email protected]"}
2222
],
2323
"require": {
24-
"php": "^7.1 || ^8.0",
24+
"php": "^7.2 || ^8.0",
2525
"dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7",
26-
"slevomat/coding-standard": "^7.0.0",
27-
"squizlabs/php_codesniffer": "^3.6.0"
26+
"slevomat/coding-standard": "^8",
27+
"squizlabs/php_codesniffer": "^3.7"
2828
},
2929
"config": {
3030
"sort-packages": true

lib/Doctrine/ruleset.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@
133133
</rule>
134134
<!-- Require usage of ::class instead of __CLASS__, get_class(), get_class($this), get_called_class() and get_parent_class() -->
135135
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference"/>
136+
<!-- https://github.com/slevomat/coding-standard#slevomatcodingstandardclassespropertydeclaration- -->
137+
<rule ref="SlevomatCodingStandard.Classes.PropertyDeclaration"/>
136138
<!-- Forbid uses of multiple traits separated by comma -->
137139
<rule ref="SlevomatCodingStandard.Classes.TraitUseDeclaration"/>
138140
<!-- Require no spaces before trait use, between trait uses and one space after trait uses -->
@@ -416,7 +418,6 @@
416418
</property>
417419
</properties>
418420
</rule>
419-
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHintSpacing"/>
420421
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
421422
<properties>
422423
<property name="traversableTypeHints" type="array">

tests/expected_report.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ tests/input/not_spacing.php 8 0
2828
tests/input/null_coalesce_equal_operator.php 1 0
2929
tests/input/null_coalesce_operator.php 3 0
3030
tests/input/optimized-functions.php 1 0
31-
tests/input/PropertyTypeHintSpacing.php 6 0
31+
tests/input/PropertyDeclaration.php 6 0
3232
tests/input/return_type_on_closures.php 21 0
3333
tests/input/return_type_on_methods.php 17 0
3434
tests/input/semicolon_spacing.php 3 0

tests/fixed/PropertyTypeHintSpacing.php renamed to tests/fixed/PropertyDeclaration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Spacing;
66

7-
final class PropertyTypeHintSpacing
7+
final class PropertyDeclaration
88
{
99
public bool $boolPropertyWithDefaultValue = false;
1010
public string $stringProperty;

tests/input/PropertyTypeHintSpacing.php renamed to tests/input/PropertyDeclaration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Spacing;
66

7-
final class PropertyTypeHintSpacing
7+
final class PropertyDeclaration
88
{
99
public bool $boolPropertyWithDefaultValue = false;
1010
public string $stringProperty;

tests/php74-compatibility.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ index c644926..7d122d2 100644
2222
+tests/input/null_coalesce_equal_operator.php 5 0
2323
tests/input/null_coalesce_operator.php 3 0
2424
tests/input/optimized-functions.php 1 0
25-
tests/input/PropertyTypeHintSpacing.php 6 0
25+
tests/input/PropertyDeclaration.php 6 0
2626
@@ -35,19 +35,20 @@ tests/input/semicolon_spacing.php 3 0
2727
tests/input/single-line-array-spacing.php 5 0
2828
tests/input/spread-operator.php 6 0

tests/php80-compatibility.patch

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/tests/expected_report.txt b/tests/expected_report.txt
2-
index c644926..d2640a7 100644
2+
index 476a58b..54630dd 100644
33
--- a/tests/expected_report.txt
44
+++ b/tests/expected_report.txt
5-
@@ -14,21 +14,22 @@ tests/input/constants-var.php 6 0
5+
@@ -14,40 +14,43 @@ tests/input/constants-var.php 6 0
66
tests/input/ControlStructures.php 28 0
77
tests/input/doc-comment-spacing.php 11 0
88
tests/input/duplicate-assignment-variable.php 1 0
@@ -26,28 +26,35 @@ index c644926..d2640a7 100644
2626
tests/input/null_coalesce_operator.php 3 0
2727
+tests/input/null_safe_operator.php 1 0
2828
tests/input/optimized-functions.php 1 0
29-
-tests/input/PropertyTypeHintSpacing.php 6 0
30-
+tests/input/PropertyTypeHintSpacing.php 7 0
31-
tests/input/return_type_on_closures.php 21 0
32-
tests/input/return_type_on_methods.php 17 0
29+
-tests/input/PropertyDeclaration.php 6 0
30+
-tests/input/return_type_on_closures.php 21 0
31+
-tests/input/return_type_on_methods.php 17 0
32+
+tests/input/PropertyDeclaration.php 7 0
33+
+tests/input/return_type_on_closures.php 26 0
34+
+tests/input/return_type_on_methods.php 22 0
3335
tests/input/semicolon_spacing.php 3 0
34-
@@ -39,15 +40,15 @@ tests/input/superfluous-naming.php 11 0
36+
tests/input/single-line-array-spacing.php 5 0
37+
tests/input/spread-operator.php 6 0
38+
tests/input/static-closures.php 1 0
39+
+tests/input/strings.php 1 0
40+
tests/input/superfluous-naming.php 11 0
3541
tests/input/test-case.php 8 0
3642
tests/input/trailing_comma_on_array.php 1 0
43+
+tests/input/TrailingCommaOnFunctions.php 2 0
3744
tests/input/traits-uses.php 11 0
3845
-tests/input/type-hints.php 4 0
39-
+tests/input/type-hints.php 5 0
46+
+tests/input/type-hints.php 9 0
4047
tests/input/UnusedVariables.php 1 0
4148
tests/input/use-ordering.php 1 0
4249
tests/input/useless-semicolon.php 2 0
4350
-tests/input/UselessConditions.php 20 0
4451
+tests/input/UselessConditions.php 21 0
4552
----------------------------------------------------------------------
4653
-A TOTAL OF 377 ERRORS AND 0 WARNINGS WERE FOUND IN 41 FILES
47-
+A TOTAL OF 395 ERRORS AND 0 WARNINGS WERE FOUND IN 42 FILES
54+
+A TOTAL OF 412 ERRORS AND 0 WARNINGS WERE FOUND IN 44 FILES
4855
----------------------------------------------------------------------
4956
-PHPCBF CAN FIX 313 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
50-
+PHPCBF CAN FIX 331 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
57+
+PHPCBF CAN FIX 346 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
5158
----------------------------------------------------------------------
5259

5360

@@ -86,19 +93,19 @@ index 57d9f2b..5493471 100644
8693

8794
public function fcn(string $A): void
8895
{
89-
diff --git a/tests/fixed/PropertyTypeHintSpacing.php b/tests/fixed/PropertyTypeHintSpacing.php
90-
index 1421913..d52353c 100644
91-
--- a/tests/fixed/PropertyTypeHintSpacing.php
92-
+++ b/tests/fixed/PropertyTypeHintSpacing.php
93-
@@ -9,5 +9,5 @@ final class PropertyTypeHintSpacing
96+
diff --git a/tests/fixed/PropertyDeclaration.php b/tests/fixed/PropertyDeclaration.php
97+
index 5c3f27b..7f286ad 100644
98+
--- a/tests/fixed/PropertyDeclaration.php
99+
+++ b/tests/fixed/PropertyDeclaration.php
100+
@@ -9,5 +9,5 @@ final class PropertyDeclaration
94101
public bool $boolPropertyWithDefaultValue = false;
95102
public string $stringProperty;
96103
public int $intProperty;
97104
- public ?string $nullableString = null;
98105
+ public string|null $nullableString = null;
99106
}
100107
diff --git a/tests/fixed/TrailingCommaOnFunctions.php b/tests/fixed/TrailingCommaOnFunctions.php
101-
index ed304c9..001650f 100644
108+
index 6e5cca4..c5fdccb 100644
102109
--- a/tests/fixed/TrailingCommaOnFunctions.php
103110
+++ b/tests/fixed/TrailingCommaOnFunctions.php
104111
@@ -11,7 +11,7 @@ class TrailingCommaOnFunctions
@@ -337,7 +344,7 @@ index 10e6f34..5e26ed8 100644
337344
+ private int|string|null $x = 1;
338345
}
339346
diff --git a/tests/input/TrailingCommaOnFunctions.php b/tests/input/TrailingCommaOnFunctions.php
340-
index ed304c9..e383ee2 100644
347+
index 6e5cca4..1d24bb6 100644
341348
--- a/tests/input/TrailingCommaOnFunctions.php
342349
+++ b/tests/input/TrailingCommaOnFunctions.php
343350
@@ -6,7 +6,7 @@ namespace Doctrine;

0 commit comments

Comments
 (0)