Skip to content

Commit

Permalink
styles: Enable and apply heredoc_indentation rule (#1939)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanmai committed Mar 20, 2024
1 parent 51c0a42 commit 656f574
Show file tree
Hide file tree
Showing 388 changed files with 13,488 additions and 13,487 deletions.
1 change: 1 addition & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
'phpdoc_order' => true,
'phpdoc_summary' => false,
'phpdoc_separation' => false,
'heredoc_indentation' => true,
'self_static_accessor' => true,
'single_line_throw' => false,
'static_lambda' => true,
Expand Down
8 changes: 4 additions & 4 deletions bin/infection
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ if (\in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true) === false) {
\fwrite(
\STDERR,
<<<'ERROR'
You need to set up the project dependencies using Composer:
$ composer install
You can learn all about Composer on https://getcomposer.org/.
You need to set up the project dependencies using Composer:
$ composer install
You can learn all about Composer on https://getcomposer.org/.
ERROR,
ERROR,
);

throw new RuntimeException('Unable to find the Composer autoloader.');
Expand Down
6 changes: 3 additions & 3 deletions src/Logger/GitHubAnnotationsLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ public function getLogLines(): array
$error = [
'line' => $escapedExecutionResult->getOriginalStartingLine(),
'message' => <<<"TEXT"
Escaped Mutant for Mutator "{$escapedExecutionResult->getMutatorName()}":
Escaped Mutant for Mutator "{$escapedExecutionResult->getMutatorName()}":
{$escapedExecutionResult->getMutantDiff()}
TEXT
{$escapedExecutionResult->getMutantDiff()}
TEXT
,
];
Expand Down
38 changes: 19 additions & 19 deletions src/Logger/Html/HtmlFileLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,26 @@ public function getLogLines(): array
{
return [
<<<"HTML"
<!DOCTYPE html>
<html>
<body>
<a href="/">Back</a>
<mutation-test-report-app title-postfix="Infection"></mutation-test-report-app>
<script defer src="https://cdn.jsdelivr.net/npm/mutation-testing-elements/dist/mutation-test-elements.js"></script>
<script>
const app = document.getElementsByTagName('mutation-test-report-app').item(0);
function updateTheme() {
document.body.style.backgroundColor = app.themeBackgroundColor;
}
app.addEventListener('theme-changed', updateTheme);
updateTheme();
<!DOCTYPE html>
<html>
<body>
<a href="/">Back</a>
<mutation-test-report-app title-postfix="Infection"></mutation-test-report-app>
<script defer src="https://cdn.jsdelivr.net/npm/mutation-testing-elements/dist/mutation-test-elements.js"></script>
<script>
const app = document.getElementsByTagName('mutation-test-report-app').item(0);
function updateTheme() {
document.body.style.backgroundColor = app.themeBackgroundColor;
}
app.addEventListener('theme-changed', updateTheme);
updateTheme();

document.getElementsByTagName('mutation-test-report-app').item(0).report = {$this->getMutationTestingReport()}
;
</script>
</body>
</html>
HTML,
document.getElementsByTagName('mutation-test-report-app').item(0).report = {$this->getMutationTestingReport()}
;
</script>
</body>
</html>
HTML,
];
}

Expand Down
12 changes: 6 additions & 6 deletions src/Mutator/Arithmetic/Assignment.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ public static function getDefinition(): ?Definition
{
return new Definition(
<<<'TXT'
Replaces examples of augmented or compound (shorter way to apply an arithmetic or bitwise operation)
assignment operators, i.e. `+=`, `*=`, `.=`, etc., with a plain assignment operator `=`.
TXT
Replaces examples of augmented or compound (shorter way to apply an arithmetic or bitwise operation)
assignment operators, i.e. `+=`, `*=`, `.=`, etc., with a plain assignment operator `=`.
TXT
,
MutatorCategory::SEMANTIC_REDUCTION,
null,
<<<'DIFF'
- $a += $b;
+ $a = $b;
DIFF,
- $a += $b;
+ $a = $b;
DIFF,
);
}

Expand Down
10 changes: 5 additions & 5 deletions src/Mutator/Arithmetic/AssignmentEqual.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ public static function getDefinition(): ?Definition
{
return new Definition(
<<<'TXT'
Replaces an equal (`==`) or identical (`===`) comparison operator with an assignment operator (`=`).
TXT
Replaces an equal (`==`) or identical (`===`) comparison operator with an assignment operator (`=`).
TXT
,
MutatorCategory::SEMANTIC_REDUCTION,
null,
<<<'DIFF'
- if ($a === self::VALUE);
+ if ($a = self::VALUE);
DIFF,
- if ($a === self::VALUE);
+ if ($a = self::VALUE);
DIFF,
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Mutator/Arithmetic/BitwiseAnd.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public static function getDefinition(): ?Definition
MutatorCategory::ORTHOGONAL_REPLACEMENT,
null,
<<<'DIFF'
- $a = $b & $c;
+ $a = $b | $c;
DIFF,
- $a = $b & $c;
+ $a = $b | $c;
DIFF,
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Mutator/Arithmetic/BitwiseNot.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public static function getDefinition(): ?Definition
MutatorCategory::SEMANTIC_REDUCTION,
null,
<<<'DIFF'
- $a = ~$b;
+ $a = $b;
DIFF,
- $a = ~$b;
+ $a = $b;
DIFF,
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Mutator/Arithmetic/BitwiseOr.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public static function getDefinition(): ?Definition
MutatorCategory::ORTHOGONAL_REPLACEMENT,
null,
<<<'DIFF'
- $a = $b | $c;
+ $a = $b & $c;
DIFF,
- $a = $b | $c;
+ $a = $b & $c;
DIFF,
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Mutator/Arithmetic/BitwiseXor.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public static function getDefinition(): ?Definition
MutatorCategory::ORTHOGONAL_REPLACEMENT,
null,
<<<'DIFF'
- $a = $b ^ $c;
+ $a = $b & $c;
DIFF,
- $a = $b ^ $c;
+ $a = $b & $c;
DIFF,
);
}

Expand Down
12 changes: 6 additions & 6 deletions src/Mutator/Arithmetic/Decrement.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ public static function getDefinition(): ?Definition
{
return new Definition(
<<<'TXT'
Replaces a pre- or post-decrement operator (`--`) with the analogue pre- or post-increment operator
(`++`).
TXT
Replaces a pre- or post-decrement operator (`--`) with the analogue pre- or post-increment operator
(`++`).
TXT
,
MutatorCategory::ORTHOGONAL_REPLACEMENT,
null,
<<<'DIFF'
- $a--;
+ $a++;
DIFF,
- $a--;
+ $a++;
DIFF,
);
}

Expand Down
10 changes: 5 additions & 5 deletions src/Mutator/Arithmetic/DivEqual.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ public static function getDefinition(): ?Definition
{
return new Definition(
<<<'TXT'
Replaces a division assignment operator (`/=`) with a multiplication assignment operator (`*=`).
TXT
Replaces a division assignment operator (`/=`) with a multiplication assignment operator (`*=`).
TXT
,
MutatorCategory::ORTHOGONAL_REPLACEMENT,
null,
<<<'DIFF'
- $a /= $b;
+ $a *= $b;
DIFF,
- $a /= $b;
+ $a *= $b;
DIFF,
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Mutator/Arithmetic/Division.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public static function getDefinition(): ?Definition
MutatorCategory::ORTHOGONAL_REPLACEMENT,
null,
<<<'DIFF'
- $a = $b / $c;
+ $a = $b * $c;
DIFF,
- $a = $b / $c;
+ $a = $b * $c;
DIFF,
);
}

Expand Down
10 changes: 5 additions & 5 deletions src/Mutator/Arithmetic/Exponentiation.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ public static function getDefinition(): ?Definition
{
return new Definition(
<<<'TXT'
Replaces an exponentiation operator (`**`) with a division assignment operator (`/`).
TXT
Replaces an exponentiation operator (`**`) with a division assignment operator (`/`).
TXT
,
MutatorCategory::ORTHOGONAL_REPLACEMENT,
null,
<<<'DIFF'
- $a = $b ** $c;
+ $a = $b / $c;
DIFF,
- $a = $b ** $c;
+ $a = $b / $c;
DIFF,
);
}

Expand Down
12 changes: 6 additions & 6 deletions src/Mutator/Arithmetic/Increment.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ public static function getDefinition(): ?Definition
{
return new Definition(
<<<'TXT'
Replaces a pre- or post-increment operator (`++`) with the analogue pre- or post-decrement operator
(`--`).
TXT
Replaces a pre- or post-increment operator (`++`) with the analogue pre- or post-decrement operator
(`--`).
TXT
,
MutatorCategory::ORTHOGONAL_REPLACEMENT,
null,
<<<'DIFF'
- $a++;
+ $a--;
DIFF,
- $a++;
+ $a--;
DIFF,
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Mutator/Arithmetic/Minus.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public static function getDefinition(): ?Definition
MutatorCategory::ORTHOGONAL_REPLACEMENT,
null,
<<<'DIFF'
- $a = $b - $c;
+ $a = $b + $c;
DIFF,
- $a = $b - $c;
+ $a = $b + $c;
DIFF,
);
}

Expand Down
10 changes: 5 additions & 5 deletions src/Mutator/Arithmetic/MinusEqual.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ public static function getDefinition(): ?Definition
{
return new Definition(
<<<'TXT'
Replaces a subtraction assignment operator (`-=`) with an addition assignment operator (`+=`).
TXT
Replaces a subtraction assignment operator (`-=`) with an addition assignment operator (`+=`).
TXT
,
MutatorCategory::ORTHOGONAL_REPLACEMENT,
null,
<<<'DIFF'
- $a -= $b;
+ $a += $b;
DIFF,
- $a -= $b;
+ $a += $b;
DIFF,
);
}

Expand Down
10 changes: 5 additions & 5 deletions src/Mutator/Arithmetic/ModEqual.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ public static function getDefinition(): ?Definition
{
return new Definition(
<<<'TXT'
Replaces a modulo assignment operator (`%=`) with a multiplication assignment operator (`*=`).
TXT
Replaces a modulo assignment operator (`%=`) with a multiplication assignment operator (`*=`).
TXT
,
MutatorCategory::ORTHOGONAL_REPLACEMENT,
null,
<<<'DIFF'
- $a %= $b;
+ $a *= $b;
DIFF,
- $a %= $b;
+ $a *= $b;
DIFF,
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Mutator/Arithmetic/Modulus.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public static function getDefinition(): ?Definition
MutatorCategory::ORTHOGONAL_REPLACEMENT,
null,
<<<'DIFF'
- $a = $b % $c;
+ $a = $b * $c;
DIFF,
- $a = $b % $c;
+ $a = $b * $c;
DIFF,
);
}

Expand Down
10 changes: 5 additions & 5 deletions src/Mutator/Arithmetic/MulEqual.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ public static function getDefinition(): ?Definition
{
return new Definition(
<<<'TXT'
Replaces a multiplication assignment operator (`*=`) with a division assignment operator (`/=`).
TXT
Replaces a multiplication assignment operator (`*=`) with a division assignment operator (`/=`).
TXT
,
MutatorCategory::ORTHOGONAL_REPLACEMENT,
null,
<<<'DIFF'
- $a *= $b;
+ $a /= $b;
DIFF,
- $a *= $b;
+ $a /= $b;
DIFF,
);
}

Expand Down
10 changes: 5 additions & 5 deletions src/Mutator/Arithmetic/Multiplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ public static function getDefinition(): ?Definition
{
return new Definition(
<<<'TXT'
Replaces a multiplication operator (`*`) with a division assignment operator (`/`).
TXT
Replaces a multiplication operator (`*`) with a division assignment operator (`/`).
TXT
,
MutatorCategory::ORTHOGONAL_REPLACEMENT,
null,
<<<'DIFF'
- $a = $b * $c;
+ $a = $b / $c;
DIFF,
- $a = $b * $c;
+ $a = $b / $c;
DIFF,
);
}

Expand Down
Loading

0 comments on commit 656f574

Please sign in to comment.