doc/DocParser: Rename 'header' to 'title'

refs #4820
This commit is contained in:
Eric Lippmann 2014-07-29 11:12:06 +02:00
parent 38a6df91b9
commit 3cafc8910a

View File

@ -131,9 +131,7 @@ class DocParser
foreach ($file as $line) { foreach ($file as $line) {
$header = $this->extractHeader($line, $lastLine); $header = $this->extractHeader($line, $lastLine);
if ($header !== null) { if ($header !== null) {
list($header, $id, $level) = $header; // When overwriting the variable to extract, it has to be list($title, $id, $level) = $header;
// list()'s first parameter since list() assigns the values
// starting with the right-most parameter
while (! $stack->isEmpty() && $stack->top()->getLevel() >= $level) { while (! $stack->isEmpty() && $stack->top()->getLevel() >= $level) {
$stack->pop(); $stack->pop();
} }
@ -143,19 +141,19 @@ class DocParser
/* @var $section Section */ /* @var $section Section */
$path[] = $section->getTitle(); $path[] = $section->getTitle();
} }
$path[] = $header; $path[] = $title;
$id = implode('-', $path); $id = implode('-', $path);
$nofollow = true; $nofollow = true;
} else { } else {
$nofollow = false; $nofollow = false;
} }
if ($stack->isEmpty()) { if ($stack->isEmpty()) {
$chapterTitle = $header; $chapterTitle = $title;
$section = new Section($id, $header, $level, $nofollow, $chapterTitle); $section = new Section($id, $title, $level, $nofollow, $chapterTitle);
$tree->addRoot($section); $tree->addRoot($section);
} else { } else {
$chapterTitle = $stack->bottom()->getTitle(); $chapterTitle = $stack->bottom()->getTitle();
$section = new Section($id, $header, $level, $nofollow, $chapterTitle); $section = new Section($id, $title, $level, $nofollow, $chapterTitle);
$tree->addChild($section, $stack->top()); $tree->addChild($section, $stack->top());
} }
$stack->push($section); $stack->push($section);