Skip to content

Commit 1e76352

Browse files
committed
Hide empty tabs
1 parent 20afe93 commit 1e76352

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ public function addQuery($query)
188188
default => $query->connection->prepareBindings($query->bindings),
189189
};
190190

191+
if (! $visibleStatements) {
192+
return [];
193+
}
194+
191195
$this->queries[] = [
192196
'query' => $sql,
193197
'type' => 'query',

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,

0 commit comments

Comments
 (0)