Skip to content

Commit 1212071

Browse files
Правки
1 parent 3afce4a commit 1212071

3 files changed

Lines changed: 13 additions & 10 deletions

File tree

Debug/DebugBar.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,8 @@ public static function render(): string
155155
$fileCount = count($appFiles);
156156
$vendorCount = count($vendorFiles);
157157

158-
// Подключаем CSS из отдельного файла
159-
$html = '';
160-
ob_start();
161-
include __DIR__ . '/style.php';
162-
$html .= ob_get_clean();
158+
// Подключаем CSS из отдельного файла (файл возвращает строку через return)
159+
$html = (string) include __DIR__ . '/style.php';
163160

164161
// Строим HTML панели
165162
$html .= <<<HTML
@@ -238,9 +235,7 @@ public static function render(): string
238235

239236
// --- JS ---
240237
$html .= '</div>';
241-
ob_start();
242-
include __DIR__ . '/script.php';
243-
$html .= ob_get_clean();
238+
$html .= (string) include __DIR__ . '/script.php';
244239

245240
return $html;
246241
}

Debug/script.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<?php
2+
3+
return <<<'JS'
14
<script>
25
function switchDebugTab(tabName) {
36
var bar = document.getElementById('pet-debug-bar');
@@ -22,4 +25,5 @@ function toggleVendorFiles() {
2225
vendorTable.style.display = checkbox.checked ? 'table' : 'none';
2326
}
2427
}
25-
</script>
28+
</script>
29+
JS;

Debug/style.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<?php
2+
3+
return <<<'CSS'
14
<style>
25
.pet-debug-bar * {
36
margin: 0;
@@ -188,4 +191,5 @@
188191
.pet-debug-bar.collapsed {
189192
max-height: 40px;
190193
}
191-
</style>
194+
</style>
195+
CSS;

0 commit comments

Comments
 (0)