本文整理汇总了PHP中PHP_CodeCoverage_Report_Node::getPathAsArray方法的典型用法代码示例。如果您正苦于以下问题:PHP PHP_CodeCoverage_Report_Node::getPathAsArray方法的具体用法?PHP PHP_CodeCoverage_Report_Node::getPathAsArray怎么用?PHP PHP_CodeCoverage_Report_Node::getPathAsArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHP_CodeCoverage_Report_Node
的用法示例。
在下文中一共展示了PHP_CodeCoverage_Report_Node::getPathAsArray方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPathAsArray
/**
* @return array
*/
public function getPathAsArray()
{
if ($this->pathArray === NULL) {
if ($this->parent === NULL) {
$this->pathArray = array();
} else {
$this->pathArray = $this->parent->getPathAsArray();
}
$this->pathArray[] = $this;
}
return $this->pathArray;
}
示例2: getBreadcrumbs
protected function getBreadcrumbs(PHP_CodeCoverage_Report_Node $node)
{
$breadcrumbs = '';
$path = $node->getPathAsArray();
$pathToRoot = array();
$max = count($path);
if ($node instanceof PHP_CodeCoverage_Report_Node_File) {
$max--;
}
for ($i = 0; $i < $max; $i++) {
$pathToRoot[] = str_repeat('../', $i);
}
foreach ($path as $step) {
if ($step !== $node) {
$breadcrumbs .= $this->getInactiveBreadcrumb($step, array_pop($pathToRoot));
} else {
$breadcrumbs .= $this->getActiveBreadcrumb($step);
}
}
return $breadcrumbs;
}
示例3: getBreadcrumbs
protected function getBreadcrumbs(PHP_CodeCoverage_Report_Node $node)
{
$breadcrumbs = '';
$path = $node->getPathAsArray();
foreach ($path as $step) {
if ($step !== $node) {
$breadcrumbs .= sprintf(' <li><a href="%s.html">%s</a> <span class="divider">/</span></li>' . "\n", $step->getId(), $step->getName());
} else {
$breadcrumbs .= sprintf(' <li class="active">%s</li>' . "\n", $step->getName());
if ($node instanceof PHP_CodeCoverage_Report_Node_Directory) {
$breadcrumbs .= sprintf(' <li>(<a href="%s.dashboard.html">Dashboard</a>)</li>' . "\n", $step->getId());
}
}
}
return $breadcrumbs;
}
示例4: setCommonTemplateVariables
/**
* @param Text_Template $template
* @param string $title
* @param PHP_CodeCoverage_Report_Node $node
*/
protected function setCommonTemplateVariables(Text_Template $template, $title, PHP_CodeCoverage_Report_Node $node = NULL)
{
$link = '';
if ($node !== NULL) {
$path = $node->getPathAsArray();
foreach ($path as $step) {
$link .= sprintf('%s<a href="%s.html">%s</a>', !empty($link) ? '/' : '', $step->getId(), $step->getName());
}
}
$template->setVar(array('title' => $title, 'link' => $link, 'charset' => $this->charset, 'date' => $this->date, 'version' => '1.1.2', 'php_version' => PHP_VERSION, 'generator' => $this->generator, 'low_upper_bound' => $this->lowUpperBound, 'high_lower_bound' => $this->highLowerBound));
}
示例5: getBreadcrumbs
protected function getBreadcrumbs(PHP_CodeCoverage_Report_Node $node)
{
$breadcrumbs = '';
$path = $node->getPathAsArray();
foreach ($path as $step) {
if ($step !== $node) {
$breadcrumbs .= $this->getInactiveBreadcrumb($step);
} else {
$breadcrumbs .= $this->getActiveBreadcrumb($step, $node instanceof PHP_CodeCoverage_Report_Node_Directory);
}
}
return $breadcrumbs;
}