/** * Returns the version of PHP_CodeCoverage. * * @return string */ public static function id() { if (self::$version === NULL) { self::$version = self::VERSION; if (is_dir(dirname(dirname(__DIR__)) . '/.git')) { $dir = getcwd(); chdir(__DIR__); $version = exec('git describe --tags'); chdir($dir); if ($version) { if (count(explode('.', self::VERSION)) == 3) { self::$version = $version; } else { $version = explode('-', $version); self::$version = self::VERSION . '-' . $version[2]; } } } } return self::$version; }
/** * @param Text_Template $template * @param PHP_CodeCoverage_Report_Node $node */ protected function setCommonTemplateVariables(Text_Template $template, PHP_CodeCoverage_Report_Node $node) { $template->setVar(array('id' => $node->getId(), 'full_path' => $node->getPath(), 'breadcrumbs' => $this->getBreadcrumbs($node), 'charset' => $this->charset, 'date' => $this->date, 'version' => PHP_CodeCoverage_Version::id(), 'php_version' => PHP_VERSION, 'generator' => $this->generator, 'low_upper_bound' => $this->lowUpperBound, 'high_lower_bound' => $this->highLowerBound)); }