Skip to content
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
1 change: 1 addition & 0 deletions src/PhpCs/FiveLab/Sniffs/Strings/StringSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function register(): array
{
return [
T_CONSTANT_ENCAPSED_STRING,
T_DOUBLE_QUOTED_STRING,
];
}

Expand Down
4 changes: 4 additions & 0 deletions tests/PhpCs/FiveLab/Sniffs/Strings/Resources/string/wrong.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@

$bar = "some string";
$foo = \sprintf("fo bar %s", "some");

$baz = new \stdClass(
"some param {$foo}"
);
4 changes: 4 additions & 0 deletions tests/PhpCs/FiveLab/Sniffs/Strings/StringSniffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public static function provideDataSet(): array
'message' => 'Use double quotes is forbidden.',
'source' => 'FiveLab.Strings.String.DoubleQuotes',
],
[
'message' => 'Use double quotes is forbidden.',
'source' => 'FiveLab.Strings.String.DoubleQuotes',
],
],
];
}
Expand Down