Skip to content

Commit

Permalink
Do not use deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jan 9, 2024
1 parent e3fb233 commit 0154ada
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/PatchCoverage.php
Expand Up @@ -41,18 +41,18 @@ public function execute(string $coverageFile, string $patchFile, string $pathPre
$changes = [];

foreach ($patch as $diff) {
$file = substr($diff->getTo(), 2);
$file = substr($diff->to(), 2);
$changes[$file] = [];

foreach ($diff->getChunks() as $chunk) {
$lineNr = $chunk->getEnd();
foreach ($diff->chunks() as $chunk) {
$lineNr = $chunk->end();

foreach ($chunk->getLines() as $line) {
if ($line->getType() === Line::ADDED) {
foreach ($chunk->lines() as $line) {
if ($line->type() === Line::ADDED) {
$changes[$file][] = $lineNr;
}

if ($line->getType() !== Line::REMOVED) {
if ($line->type() !== Line::REMOVED) {
$lineNr++;
}
}
Expand Down

0 comments on commit 0154ada

Please sign in to comment.