protected function collectFileCoverage(\SimpleXMLElement $file, $root)
    {
        $absolutePath = realpath((string) ($file['path'] ?: $file['name']));

        if (strpos($absolutePath, $root) === false) {
            return;
        }

        $filename = $absolutePath;

        if ($root !== DIRECTORY_SEPARATOR) {
            $filename = str_replace($root, '', $absolutePath);
        }

        return $this->collectCoverage($file, $absolutePath, $filename);
    }