Skip to content

Commit

Permalink
Fix default printer
Browse files Browse the repository at this point in the history
  • Loading branch information
gehrisandro committed Nov 20, 2023
1 parent 44e1765 commit 707dff0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion WIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# Backlog Prio 1
- [ ] Add minimum threshold enforcement
- [ ] Finish: Disable mutations by annotation
- [ ] Run mutations in a resonable order: New, Survived, NotCovered, Skipped, Killed (Survived first, if --stop-on-survived or --bail; NotCovered first, if --stop-on-uncovered)
- [ ] Run mutations in a reasonable order: New, Survived, NotCovered, Skipped, Killed (Survived first, if --stop-on-survived or --bail; NotCovered first, if --stop-on-uncovered)
- [ ] Log to file
- [ ] Automatically skip "Arch" tests

Expand Down
8 changes: 4 additions & 4 deletions src/Mutation.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Mutation
.'mutations';

/**
* @param array{original: string[], modified: string[]} $diff
* @param array{original: string[], modified: array<int, ?string>} $diff
*/
public function __construct(
public readonly SplFileInfo $file,
Expand Down Expand Up @@ -68,7 +68,7 @@ public function modifiedSource(): string
}

/**
* @return array{original: string[], modified: string[]}
* @return array{original: string[], modified: array<int, ?string>}
*/
private static function diff(Node $originalNode, ?Node $modifiedNode): array
{
Expand All @@ -84,7 +84,7 @@ private static function diff(Node $originalNode, ?Node $modifiedNode): array
}

/**
* @return array{file: string, mutator: string, start_line: int, end_line: int, diff: array{original: string[], modified: string[]}, modified_source_path: string}
* @return array{file: string, mutator: string, start_line: int, end_line: int, diff: array{original: string[], modified: array<int, ?string>}, modified_source_path: string}
*/
public function __serialize(): array
{
Expand All @@ -99,7 +99,7 @@ public function __serialize(): array
}

/**
* @param array{file: string, mutator: string, start_line: int, end_line: int, diff: array{original: string[], modified: string[]}, modified_source_path: string} $data
* @param array{file: string, mutator: string, start_line: int, end_line: int, diff: array{original: string[], modified: array<int, ?string>}, modified_source_path: string} $data
*/
public function __unserialize(array $data): void
{
Expand Down
4 changes: 2 additions & 2 deletions src/Support/Printers/DefaultPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ private function writeMutationTestSummary(MutationTest $test): void

$diff = '';
foreach ($test->mutation->diff['modified'] as $line) {
$line = htmlentities($line); // TODO: this is not good, but currently required other printer breaks on `$this->foo()` because of the >
$line = htmlentities((string) $line); // TODO: this is not good, but currently required, otherwise printer breaks on `$this->foo()` because of the >
$diff .= "<div class='text-green'>+ {$line}</div>";
}
foreach ($test->mutation->diff['original'] as $line) {
$line = htmlentities($line); // TODO: this is not good, but currently required other printer breaks on `$this->foo()` because of the >
$line = htmlentities($line); // TODO: this is not good, but currently required, otherwise printer breaks on `$this->foo()` because of the >
$diff .= "<div class='text-red'>- {$line}</div>";
}

Expand Down

0 comments on commit 707dff0

Please sign in to comment.