Backup #1844
| ID | 1844 |
| Dateipfad | /var/www/dev.campus.systemische-tools.de/src/UseCases/CodeAnalysis/GetCodeAnalysisUseCase.php |
| Version | 5 |
| Typ |
modified |
| Größe | 2.5 KB |
| Hash | 10722c3017bc0c46aa5ad352dc57e1740e34bbd305d74e63563ba4f927984b68 |
| Datum | 2025-12-27 23:22:15 |
| Geändert von | claude-code-hook |
| Grund | Claude Code Pre-Hook Backup vor Edit-Operation |
| Datei existiert |
Ja
|
Dateiinhalt
<?php
declare(strict_types=1);
namespace UseCases\CodeAnalysis;
// @responsibility: Orchestriert Code-Analyse-Abfragen
use Domain\Repository\DependencyGraphRepositoryInterface;
use Domain\Repository\FileAnalysisRepositoryInterface;
use Domain\Service\CodeScannerInterface;
final class GetCodeAnalysisUseCase
{
public function __construct(
private FileAnalysisRepositoryInterface $fileRepository,
private DependencyGraphRepositoryInterface $dependencyRepository,
private CodeScannerInterface $scanner
) {
}
/**
* @param array<string, mixed> $filters
* @return array<array<string, mixed>>
*/
public function execute(array $filters = [], int $limit = 100, int $offset = 0): array
{
return $this->fileRepository->findAll($filters, $limit, $offset);
}
/**
* @return array<string, mixed>|null
*/
public function findById(int $id): ?array
{
return $this->fileRepository->findById($id);
}
/**
* @return array<string, mixed>
*/
public function getStatistics(): array
{
return $this->fileRepository->getStatistics();
}
/**
* @return array{directories: array<string>, namespaces: array<string>}
*/
public function getFilterOptions(): array
{
return [
'directories' => $this->fileRepository->getDistinctDirectories(),
'namespaces' => $this->fileRepository->getDistinctNamespaces(),
];
}
/**
* @return array{scan_id: string, files_scanned: int, files_with_errors: int, total_classes: int, total_functions: int, duration_ms: int}
*/
public function runScan(string $triggeredBy = 'web'): array
{
return $this->scanner->scan(null, $triggeredBy);
}
public function getLatestScanId(): ?string
{
return $this->fileRepository->getLatestScanId();
}
/**
* Find files that depend on a given FQCN.
*
* @return array<array{id: int, file_name: string, file_path: string, namespace: string|null, dependency_type: string}>
*/
public function findDependents(string $fqcn): array
{
return $this->dependencyRepository->findDependents($fqcn);
}
/**
* Get global graph data for entire project.
*
* @return array{nodes: array<array<string, mixed>>, links: array<array<string, mixed>>, stats: array<string, int>}
*/
public function getGlobalGraphData(): array
{
return $this->dependencyRepository->getGlobalGraphData();
}
}
Vollständig herunterladen
Aktionen
Andere Versionen dieser Datei
| ID |
Version |
Typ |
Größe |
Datum |
| 1846 |
6 |
modified |
2.5 KB |
2025-12-27 23:22 |
| 1844 |
5 |
modified |
2.5 KB |
2025-12-27 23:22 |
| 1255 |
4 |
modified |
2.5 KB |
2025-12-25 12:46 |
| 1254 |
3 |
modified |
2.3 KB |
2025-12-25 12:46 |
| 892 |
2 |
modified |
2.0 KB |
2025-12-23 15:40 |
| 887 |
1 |
modified |
1.7 KB |
2025-12-23 15:28 |
← Zurück zur Übersicht