/** @return string */ private function prepareCodeCoverage() { if (!$this->interpreter->hasXdebug()) { throw new \Exception("Code coverage functionality requires Xdebug extension (used {$this->interpreter->getCommandLine()})"); } file_put_contents($this->options['--coverage'], ''); $file = realpath($this->options['--coverage']); putenv(Environment::COVERAGE . '=' . $file); echo "Code coverage: {$file}\n"; if (preg_match('#\\.html?\\z#', $file)) { return $file; } }
/** @return string */ private function prepareCodeCoverage() { if (!$this->interpreter->hasXdebug()) { $alternative = PHP_VERSION_ID >= 70000 ? ' or phpdbg SAPI' : ''; throw new \Exception("Code coverage functionality requires Xdebug extension{$alternative} (used {$this->interpreter->getCommandLine()})"); } file_put_contents($this->options['--coverage'], ''); $file = realpath($this->options['--coverage']); putenv(Environment::COVERAGE . '=' . $file); echo "Code coverage: {$file}\n"; if (preg_match('#\\.(?:html?|xml)\\z#', $file)) { return $file; } }