feat: Add String Concatenation to String Interpolation Fixer #9676
Annotations
21 errors and 10 warnings
PHP 8.3 Fixer
Process completed with exit code 255.
|
PHP 8.2 Fixer
Process completed with exit code 255.
|
PHP 8.0 Fixer
Process completed with exit code 255.
|
PHP 8.4 Fixer
Process completed with exit code 255.
|
PHP 7.4 Fixer with lowest deps
Process completed with exit code 255.
|
PHP 8.3 Fixer with migration rules
Process completed with exit code 255.
|
PHP 8.4 tests
Process completed with exit code 255.
|
PHP 8.1 Fixer with Symfony ^6
Process completed with exit code 255.
|
PHP 8.3 Fixer with Symfony ^7
Process completed with exit code 255.
|
PHP 8.3 tests with migration rules
Process completed with exit code 255.
|
PHP 8.3 Fixer on Windows
Process completed with exit code 1.
|
PHP 8.3 Fixer on macOS
Process completed with exit code 255.
|
PHP 8.0 tests
Process completed with exit code 10.
|
PHP 8.3 tests on macOS
Process completed with exit code 10.
|
PHP 8.3 tests
Process completed with exit code 10.
|
PHP 8.1 tests with Symfony ^6
Process completed with exit code 10.
|
PHP 7.4 tests with lowest deps
Process completed with exit code 10.
|
PHP 8.3 tests on Windows
Process completed with exit code 1.
|
PHP 8.2 tests
Process completed with exit code 10.
|
PHP 8.3 tests with Symfony ^7
Process completed with exit code 10.
|
PHP 8.3 code coverage
Process completed with exit code 10.
|
PHP 8.3 mutation tests:
src/Fixer/Operator/StringConcatenationToInterpolationFixer.php#L66
Escaped Mutant for Mutator "ElseIfNegation":
--- Original
+++ New
@@ @@
$has_changed = $this->handleVariableSomethingCase($tokens, $index);
} elseif (is_simple_string($token)) {
$has_changed = $this->handleStringSomethingCase($tokens, $index);
- } elseif (is_interpolation_quote($token)) {
+ } elseif (!is_interpolation_quote($token)) {
$has_changed = $this->handleInterpSomethingCase($tokens, $index);
}
if (!$has_changed) {
|
PHP 8.3 mutation tests:
src/Fixer/Operator/StringConcatenationToInterpolationFixer.php#L78
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
}
private function removeEmptyStringConcatenation(\SplFileInfo $file, Tokens $tokens) : void
{
- for ($index = \count($tokens) - 1; $index >= 0; --$index) {
+ for ($index = \count($tokens) - 2; $index >= 0; --$index) {
$token = $tokens[$index];
if (is_empty_string($token)) {
$this->removeConcatenationAndEmptyString($tokens, $index);
|
PHP 8.3 mutation tests:
src/Fixer/Operator/StringConcatenationToInterpolationFixer.php#L78
Escaped Mutant for Mutator "GreaterThanOrEqualTo":
--- Original
+++ New
@@ @@
}
private function removeEmptyStringConcatenation(\SplFileInfo $file, Tokens $tokens) : void
{
- for ($index = \count($tokens) - 1; $index >= 0; --$index) {
+ for ($index = \count($tokens) - 1; $index > 0; --$index) {
$token = $tokens[$index];
if (is_empty_string($token)) {
$this->removeConcatenationAndEmptyString($tokens, $index);
|
PHP 8.3 mutation tests:
src/Fixer/Operator/StringConcatenationToInterpolationFixer.php#L116
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
private function removeUselessConcatenation(\SplFileInfo $file, Tokens $tokens) : void
{
$concat_fixer = new NoUselessConcatOperatorFixer();
- $concat_fixer->configure(['juggle_simple_strings' => true]);
+ $concat_fixer->configure(['juggle_simple_strings' => false]);
$concat_fixer->applyFix($file, $tokens);
}
/**
|
PHP 8.3 mutation tests:
src/Fixer/Operator/StringConcatenationToInterpolationFixer.php#L116
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
private function removeUselessConcatenation(\SplFileInfo $file, Tokens $tokens) : void
{
$concat_fixer = new NoUselessConcatOperatorFixer();
- $concat_fixer->configure(['juggle_simple_strings' => true]);
+ $concat_fixer->configure([]);
$concat_fixer->applyFix($file, $tokens);
}
/**
|
PHP 8.3 mutation tests:
src/Fixer/Operator/StringConcatenationToInterpolationFixer.php#L116
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
private function removeUselessConcatenation(\SplFileInfo $file, Tokens $tokens) : void
{
$concat_fixer = new NoUselessConcatOperatorFixer();
- $concat_fixer->configure(['juggle_simple_strings' => true]);
+
$concat_fixer->applyFix($file, $tokens);
}
/**
|
PHP 8.3 mutation tests:
src/Fixer/Operator/StringConcatenationToInterpolationFixer.php#L204
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
$tokens->overrideRange($variable_end_index + 1, $right_string_index, [get_close_curly_token(), get_raw_string_token($right_string_token), get_close_interpolation_token()]);
// Replaces `$var` by `"{$var`
$tokens->insertAt($variable_index, [get_open_interpolation_token(), get_open_curly_token()]);
- return true;
+ return false;
}
/**
* Transforms `$var . " {$interp}"` to `"{$var} {$interp}"`.
|
PHP 8.3 mutation tests:
src/Fixer/Operator/StringConcatenationToInterpolationFixer.php#L233
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
$tokens->overrideRange($variable_end_index + 1, $open_quote_index, [get_close_curly_token()]);
// Replaces `$var . "` by `"{$var`
$tokens->insertAt($variable_index, [get_open_interpolation_token(), get_open_curly_token()]);
- return true;
+ return false;
}
/**
* Transforms `$var . $var` to `"{$var}{$var}"`.
|
PHP 8.3 mutation tests:
src/Fixer/Operator/StringConcatenationToInterpolationFixer.php#L276
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
$tokens->overrideRange($left_variable_end_index + 1, $right_variable_index - 1, [get_close_curly_token(), get_open_curly_token()]);
// Replaces `$var` by `"{$var`
$tokens->insertAt($left_variable_index, [get_open_interpolation_token(), get_open_curly_token()]);
- return true;
+ return false;
}
/**
* Transforms `'string ' . $var` to `"string {$var}"`
|
PHP 8.3 mutation tests:
src/Fixer/Operator/StringConcatenationToInterpolationFixer.php#L371
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
$left_string_token = $tokens[$left_string_index];
// Replaces `'string ' . "` by `"string `
$tokens->overrideRange($left_string_index, $open_quote_index, [get_open_interpolation_token(), get_raw_string_token($left_string_token)]);
- return true;
+ return false;
}
/**
* Transforms `"{$interp} " . $var` to `"{$interp} {$var}"`
|