diff --git a/src/Driver/PHPDBG.php b/src/Driver/PHPDBG.php index 86cc8444c..a2ff72adc 100644 --- a/src/Driver/PHPDBG.php +++ b/src/Driver/PHPDBG.php @@ -47,6 +47,12 @@ public function start($determineUnusedAndDead = true) phpdbg_start_oplog(); } + private function getFiles() { + return array_filter(get_included_files(), function ($value, $key) { + return strpos(dirname($value), realpath(__DIR__.'/../../../../../src')) !== false; + }, ARRAY_FILTER_USE_BOTH); + } + /** * Stop collection of code coverage information. * @@ -59,10 +65,10 @@ public function stop() $dbgData = phpdbg_end_oplog(); if ($fetchedLines == []) { - $sourceLines = phpdbg_get_executable(); + $sourceLines = phpdbg_get_executable(['files' => $this->getFiles()]); } else { $newFiles = array_diff( - get_included_files(), + $this->getFiles(), array_keys($fetchedLines) );