ProtokollController.php
- Pfad:
src/Controller/ProtokollController.php - Namespace: Controller
- Zeilen: 67 | Größe: 2,192 Bytes
- Geändert: 2025-12-23 07:53:34 | Gescannt: 2025-12-31 10:22:15
Code Hygiene Score: 100
- Dependencies: 100 (25%)
- LOC: 100 (20%)
- Methods: 100 (20%)
- Secrets: 100 (15%)
- Classes: 100 (10%)
- Magic Numbers: 100 (10%)
Keine Issues gefunden.
Dependencies 4
- extends Framework\Controller
- constructor UseCases\Protokoll\ViewProtokollUseCase
- use Framework\Controller
- use UseCases\Protokoll\ViewProtokollUseCase
Klassen 1
-
ProtokollControllerclass Zeile 12
Funktionen 3
-
__construct()public Zeile 16 -
index()public Zeile 21 -
show()public Zeile 50
Versionen 15
-
v15
2025-12-23 07:53 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v14
2025-12-23 04:47 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v13
2025-12-22 10:32 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v12
2025-12-22 10:32 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v11
2025-12-22 10:27 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Write-Operation -
v10
2025-12-22 10:19 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v9
2025-12-22 08:55 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v8
2025-12-22 08:12 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v7
2025-12-22 08:12 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v6
2025-12-22 08:12 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v5
2025-12-22 08:05 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v4
2025-12-22 01:46 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v3
2025-12-20 19:56 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v2
2025-12-20 17:23 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v1
2025-12-20 16:08 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation
Code
<?php
declare(strict_types=1);
namespace Controller;
// @responsibility: HTTP-Endpunkte für KI-Protokoll-Anzeige
use Framework\Controller;
use UseCases\Protokoll\ViewProtokollUseCase;
class ProtokollController extends Controller
{
private ViewProtokollUseCase $protokollUseCase;
public function __construct(ViewProtokollUseCase $protokollUseCase)
{
$this->protokollUseCase = $protokollUseCase;
}
public function index(): void
{
$pagination = $this->getPagination(50);
$search = $this->getString('search');
$status = $this->getString('status');
$model = $this->getString('model');
$searchVal = $search !== '' ? $search : null;
$statusVal = $status !== '' ? $status : null;
$modelVal = $model !== '' ? $model : null;
$result = $this->protokollUseCase->getPaginated($searchVal, $statusVal, $modelVal, $pagination);
$updatedPagination = $result['pagination'];
$this->view('protokoll.index', [
'title' => 'KI-Protokoll',
'stats' => $this->protokollUseCase->getStatistics(),
'entries' => array_map(fn ($dto) => $dto->toArray(), $result['entries']),
'models' => $this->protokollUseCase->getDistinctModels(),
'currentSearch' => $search,
'currentStatus' => $status,
'currentModel' => $model,
'currentPage' => $updatedPagination->page,
'totalCount' => $updatedPagination->totalCount,
'totalPages' => $updatedPagination->totalPages(),
]);
}
public function show(string $id): void
{
$entry = $this->protokollUseCase->getById((int) $id);
if ($entry === null) {
$this->notFound('Protokoll-Eintrag nicht gefunden');
}
$nav = $this->protokollUseCase->getNavigation((int) $id);
$this->view('protokoll.show', [
'title' => 'Protokoll #' . $id,
'entry' => $entry->toArray(),
'prevEntry' => $nav['prevId'] !== null ? ['id' => $nav['prevId']] : false,
'nextEntry' => $nav['nextId'] !== null ? ['id' => $nav['nextId']] : false,
]);
}
}