Doc: Fix detection whether documentation is empty

This commit is contained in:
Eric Lippmann 2015-12-21 11:09:20 +01:00
parent 720e022bea
commit dad9538496
2 changed files with 11 additions and 1 deletions

View File

@ -84,4 +84,14 @@ class TreeNodeIterator implements RecursiveIterator
{
return new static($this->current());
}
/**
* Get whether the iterator is empty
*
* @return bool
*/
public function isEmpty()
{
return empty($this->children);
}
}

View File

@ -70,7 +70,7 @@ class DocTocRenderer extends DocRenderer
*/
public function render()
{
if (empty($this->content)) {
if ($this->getInnerIterator()->isEmpty()) {
return '<p>' . mt('doc', 'Documentation is empty.') . '</p>';
}
$view = $this->getView();