Skip to content

Commit f48be20

Browse files
committed
Only show accordion if not empty
1 parent 1d4f2cc commit f48be20

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

src/PHPFUI/InstaDoc/Page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace PHPFUI\InstaDoc;
44

5-
class Page extends \PHPFUI\Page implements PageInterface
5+
class Page extends \PHPFUI\Page implements \PHPFUI\InstaDoc\PageInterface
66
{
77
private $controller;
88
private $generating = '';

src/PHPFUI/InstaDoc/Section/Doc.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ public function generate(\PHPFUI\Instadoc\PageInterface $page, string $fullClass
9898
{
9999
$table->addRow([$this->getClassName($name)]);
100100
}
101-
$accordion->addTab('Extends', $table);
101+
if (count($table))
102+
{
103+
$accordion->addTab('Extends', $table);
104+
}
102105

103106

104107
$table = new \PHPFUI\Table();
@@ -109,7 +112,10 @@ public function generate(\PHPFUI\Instadoc\PageInterface $page, string $fullClass
109112
{
110113
$table->addRow([$this->getClassName($class)]);
111114
}
112-
$accordion->addTab('Children', $table);
115+
if (count($table))
116+
{
117+
$accordion->addTab('Children', $table);
118+
}
113119

114120
$interfaces = $this->reflection->getInterfaces();
115121

@@ -125,10 +131,16 @@ public function generate(\PHPFUI\Instadoc\PageInterface $page, string $fullClass
125131
$class = $interface->getName();
126132
$table->addRow([$this->getClassName($interface->getName())]);
127133
}
128-
$accordion->addTab('Implements', $table);
134+
if (count($table))
135+
{
136+
$accordion->addTab('Implements', $table);
137+
}
129138
}
130139

131-
$container->add($accordion);
140+
if (count($accordion))
141+
{
142+
$container->add($accordion);
143+
}
132144

133145
$parent = $this->reflection->getParentClass();
134146

0 commit comments

Comments
 (0)