Skip to content

Commit 2c7cf86

Browse files
committed
fix: CI failure on profiler page and logs endpoint
- DebugLogsController: add guard to ensure $filters is never null (prevents 'Argument #1 must be of type array, null given' error) - ProfilerController: add guard to ensure template name is not empty (prevents 'Argument #1 cannot be empty' error from Twig)
1 parent 96bb475 commit 2c7cf86

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎src/EduFramework/Core/Controller/Debug/DebugLogsController.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public function execute(Request $request): string|null
5555
'from' => $this->filterPattern($request->get('from'), '/^\d{4}-\d{2}-\d{2}$/'),
5656
'until' => $this->filterPattern($request->get('until'), '/^\d{4}-\d{2}-\d{2}$/'),
5757
];
58+
$filters = $filters ?? [];
5859

5960
$limit = min(100, max(1, (int) ($request->get('limit') ?? 20)));
6061
$page = max(1, (int) ($request->get('page') ?? 1));

‎src/EduFramework/Core/Controller/Debug/ProfilerController.php‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,13 @@ public function execute(Request $request): string|null
4141
ConfigCore::setConfig('twig_path', __DIR__ . '/../Template');
4242
TwigCore::setEnvironment();
4343

44+
$templateName = 'profiler.html.twig';
45+
if (empty($templateName)) {
46+
throw new \RuntimeException('Template name for profiler page cannot be empty');
47+
}
48+
4449
return TwigCore::getEnvironment()->render(
45-
'profiler.html.twig',
50+
$templateName,
4651
[
4752
'version' => ConfigCore::getConfig('version'),
4853
'phpVersion' => PHP_VERSION,

0 commit comments

Comments
 (0)