diff --git a/lib/Doctrine/ruleset.xml b/lib/Doctrine/ruleset.xml index 50809b49..d841c154 100644 --- a/lib/Doctrine/ruleset.xml +++ b/lib/Doctrine/ruleset.xml @@ -266,6 +266,8 @@ + + diff --git a/tests/fixed/null_safe_operator.php b/tests/fixed/null_safe_operator.php new file mode 100644 index 00000000..5bbb636c --- /dev/null +++ b/tests/fixed/null_safe_operator.php @@ -0,0 +1,5 @@ +property; diff --git a/tests/input/null_safe_operator.php b/tests/input/null_safe_operator.php new file mode 100644 index 00000000..5bbb636c --- /dev/null +++ b/tests/input/null_safe_operator.php @@ -0,0 +1,5 @@ +property; diff --git a/tests/php80-compatibility.patch b/tests/php80-compatibility.patch index 93ebeea0..7cceac94 100644 --- a/tests/php80-compatibility.patch +++ b/tests/php80-compatibility.patch @@ -1,8 +1,8 @@ diff --git a/tests/expected_report.txt b/tests/expected_report.txt -index c644926..1b5b271 100644 +index c644926..d0f0a44 100644 --- a/tests/expected_report.txt +++ b/tests/expected_report.txt -@@ -15,17 +15,17 @@ tests/input/ControlStructures.php 28 0 +@@ -15,18 +15,19 @@ tests/input/ControlStructures.php 28 0 tests/input/doc-comment-spacing.php 11 0 tests/input/duplicate-assignment-variable.php 1 0 tests/input/EarlyReturn.php 6 0 @@ -22,9 +22,11 @@ index c644926..1b5b271 100644 -tests/input/null_coalesce_equal_operator.php 1 0 +tests/input/null_coalesce_equal_operator.php 5 0 tests/input/null_coalesce_operator.php 3 0 ++tests/input/null_safe_operator.php 1 0 tests/input/optimized-functions.php 1 0 tests/input/PropertyTypeHintSpacing.php 6 0 -@@ -39,15 +39,15 @@ tests/input/superfluous-naming.php 11 0 + tests/input/return_type_on_closures.php 21 0 +@@ -39,15 +40,15 @@ tests/input/superfluous-naming.php 11 0 tests/input/test-case.php 8 0 tests/input/trailing_comma_on_array.php 1 0 tests/input/traits-uses.php 11 0 @@ -36,10 +38,10 @@ index c644926..1b5b271 100644 tests/input/UselessConditions.php 20 0 ---------------------------------------------------------------------- -A TOTAL OF 377 ERRORS AND 0 WARNINGS WERE FOUND IN 41 FILES -+A TOTAL OF 390 ERRORS AND 0 WARNINGS WERE FOUND IN 41 FILES ++A TOTAL OF 391 ERRORS AND 0 WARNINGS WERE FOUND IN 42 FILES ---------------------------------------------------------------------- -PHPCBF CAN FIX 313 OF THESE SNIFF VIOLATIONS AUTOMATICALLY -+PHPCBF CAN FIX 326 OF THESE SNIFF VIOLATIONS AUTOMATICALLY ++PHPCBF CAN FIX 327 OF THESE SNIFF VIOLATIONS AUTOMATICALLY ---------------------------------------------------------------------- @@ -138,6 +140,16 @@ index 8846dd1..51c361c 100644 $bar = $bar['baz'] ?? 'baz'; +diff --git a/tests/fixed/null_safe_operator.php b/tests/fixed/null_safe_operator.php +index 5bbb636..7ce8a3d 100644 +--- a/tests/fixed/null_safe_operator.php ++++ b/tests/fixed/null_safe_operator.php +@@ -2,4 +2,4 @@ + + declare(strict_types=1); + +-$var = $object === null ? null : $object->property; ++$var = $object?->property; diff --git a/tests/fixed/type-hints.php b/tests/fixed/type-hints.php index 0e952fc..9824fb0 100644 --- a/tests/fixed/type-hints.php