Skip to content

Commit d9c9b7b

Browse files
dvdougsebastianbergmann
authored andcommitted
Remove some ancient workarounds for very old Xdebug versions
1 parent 77d0aee commit d9c9b7b

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

src/Driver/Xdebug.php

-42
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@
1717
*/
1818
final class Xdebug implements Driver
1919
{
20-
/**
21-
* @var array
22-
*/
23-
private $cacheNumLines = [];
24-
2520
/**
2621
* @var Filter
2722
*/
@@ -68,43 +63,6 @@ public function stop(): array
6863

6964
\xdebug_stop_code_coverage();
7065

71-
return $this->cleanup($data);
72-
}
73-
74-
private function cleanup(array $data): array
75-
{
76-
foreach (\array_keys($data) as $file) {
77-
unset($data[$file][0]);
78-
79-
if (!$this->filter->isFile($file)) {
80-
continue;
81-
}
82-
83-
$numLines = $this->getNumberOfLinesInFile($file);
84-
85-
foreach (\array_keys($data[$file]) as $line) {
86-
if ($line > $numLines) {
87-
unset($data[$file][$line]);
88-
}
89-
}
90-
}
91-
9266
return $data;
9367
}
94-
95-
private function getNumberOfLinesInFile(string $fileName): int
96-
{
97-
if (!isset($this->cacheNumLines[$fileName])) {
98-
$buffer = \file_get_contents($fileName);
99-
$lines = \substr_count($buffer, "\n");
100-
101-
if (\substr($buffer, -1) !== "\n") {
102-
$lines++;
103-
}
104-
105-
$this->cacheNumLines[$fileName] = $lines;
106-
}
107-
108-
return $this->cacheNumLines[$fileName];
109-
}
11068
}

0 commit comments

Comments
 (0)