From 6688646dbe7fe00f9ff1ede6d55b573289a926ff Mon Sep 17 00:00:00 2001 From: abluchet Date: Tue, 14 Nov 2017 17:21:43 +0100 Subject: [PATCH] try --- src/Driver/PHPDBG.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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) );