Skip to content

Commit 53ecf85

Browse files
committed
Hide empty tabs
1 parent 20afe93 commit 53ecf85

File tree

5 files changed

+30
-0
lines changed

5 files changed

+30
-0
lines changed

src/DataCollector/CacheCollector.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ public function collect()
7070
$data = parent::collect();
7171
$data['nb_measures'] = count($data['measures']);
7272

73+
if (! $data['nb_measures']) {
74+
return [];
75+
}
76+
7377
return $data;
7478
}
7579

src/DataCollector/EventCollector.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ public function collect()
9999
$data = parent::collect();
100100
$data['nb_measures'] = count($data['measures']);
101101

102+
if (! $data['nb_measures']) {
103+
return [];
104+
}
105+
102106
return $data;
103107
}
104108

src/DataCollector/QueryCollector.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,11 @@ public function collect()
584584
}
585585

586586
$visibleStatements = count($statements) - $this->infoStatements;
587+
588+
if (! $visibleStatements) {
589+
return [];
590+
}
591+
587592
$data = [
588593
'nb_statements' => $this->queryCount,
589594
'nb_visible_statements' => $visibleStatements,

src/DataCollector/ViewCollector.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ public function collect()
201201
$templates = $this->templates;
202202
}
203203

204+
if (empty($this->templates)) {
205+
return [];
206+
}
207+
204208
return [
205209
'nb_templates' => count($this->templates),
206210
'templates' => $templates,

tests/BrowserTestCase.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ class BrowserTestCase extends \Orchestra\Testbench\Dusk\TestCase
1010
protected static $baseServeHost = '127.0.0.1';
1111
protected static $baseServePort = 9292;
1212

13+
/**
14+
* Define environment setup.
15+
*
16+
* @param \Illuminate\Foundation\Application $app
17+
*
18+
* @return void
19+
*/
20+
protected function getEnvironmentSetUp($app)
21+
{
22+
parent::getEnvironmentSetUp($app);
23+
config(['debugbar.hide_empty_tabs' => false]);
24+
}
25+
1326
/**
1427
* Get package providers.
1528
*

0 commit comments

Comments
 (0)