From c140fc0e5039a55cedf0de5ab53ada245f56db49 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sun, 11 Dec 2022 10:29:04 +0100 Subject: [PATCH] String interpolation: don't suggest sprintf() --- lib/Doctrine/ruleset.xml | 3 --- tests/expected_report.txt | 6 +++--- tests/fixed/strings.php | 10 ++++++++++ tests/input/strings.php | 10 ++++++++++ tests/php72-compatibility.patch | 8 ++++---- tests/php73-compatibility.patch | 8 ++++---- tests/php74-compatibility.patch | 8 ++++---- tests/php80-compatibility.patch | 8 ++++---- 8 files changed, 39 insertions(+), 22 deletions(-) diff --git a/lib/Doctrine/ruleset.xml b/lib/Doctrine/ruleset.xml index 2c5a109e..ed99bc4e 100644 --- a/lib/Doctrine/ruleset.xml +++ b/lib/Doctrine/ruleset.xml @@ -599,9 +599,6 @@ - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - diff --git a/tests/expected_report.txt b/tests/expected_report.txt index d1e1fadd..17734237 100644 --- a/tests/expected_report.txt +++ b/tests/expected_report.txt @@ -40,7 +40,7 @@ tests/input/semicolon_spacing.php 3 0 tests/input/single-line-array-spacing.php 5 0 tests/input/spread-operator.php 6 0 tests/input/static-closures.php 1 0 -tests/input/strings.php 1 0 +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 @@ -52,9 +52,9 @@ tests/input/use-ordering.php 1 0 tests/input/useless-semicolon.php 2 0 tests/input/UselessConditions.php 21 0 ---------------------------------------------------------------------- -A TOTAL OF 451 ERRORS AND 0 WARNINGS WERE FOUND IN 48 FILES +A TOTAL OF 453 ERRORS AND 0 WARNINGS WERE FOUND IN 48 FILES ---------------------------------------------------------------------- -PHPCBF CAN FIX 374 OF THESE SNIFF VIOLATIONS AUTOMATICALLY +PHPCBF CAN FIX 375 OF THESE SNIFF VIOLATIONS AUTOMATICALLY ---------------------------------------------------------------------- diff --git a/tests/fixed/strings.php b/tests/fixed/strings.php index 2da214ea..29235c40 100644 --- a/tests/fixed/strings.php +++ b/tests/fixed/strings.php @@ -7,3 +7,13 @@ $doc = <<<'TEXT' text without special chars TEXT; + +$interpolated = <<