From 0154adaa9a9c53c1d0e2de7725104f00b416a533 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Tue, 9 Jan 2024 08:18:59 +0100 Subject: [PATCH] Do not use deprecated methods --- src/PatchCoverage.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/PatchCoverage.php b/src/PatchCoverage.php index 43181c5..10254bc 100644 --- a/src/PatchCoverage.php +++ b/src/PatchCoverage.php @@ -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++; } }