From 3d2ef9a6e7f44a16ed71a4246c160dddc19cb696 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Tue, 20 Jul 2021 08:55:08 +0200 Subject: [PATCH] Require Null Safe Object operator --- lib/Doctrine/ruleset.xml | 2 ++ tests/fixed/null_safe_operator.php | 5 +++++ tests/input/null_safe_operator.php | 5 +++++ tests/php80-compatibility.patch | 12 +++++++----- 4 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 tests/fixed/null_safe_operator.php create mode 100644 tests/input/null_safe_operator.php 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..7ce8a3dc --- /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..7d8919e6 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 ----------------------------------------------------------------------