Some checks failed
Deploy Application / deploy (push) Has been cancelled
62 lines
1.5 KiB
PHP
62 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
require_once __DIR__ . '/../../vendor/autoload.php';
|
|
|
|
use App\Framework\View\Linting\ComponentLinter;
|
|
|
|
$linter = new ComponentLinter();
|
|
|
|
// Test mit Test-Template
|
|
$testFile = __DIR__ . '/test-template.view.php';
|
|
|
|
echo "Testing ComponentLinter comprehensively\n";
|
|
echo str_repeat('=', 80) . "\n\n";
|
|
|
|
$issues = $linter->lint($testFile);
|
|
|
|
if (empty($issues)) {
|
|
echo "✅ No issues found!\n";
|
|
} else {
|
|
echo "Found " . count($issues) . " issues:\n\n";
|
|
|
|
// Gruppiere nach Typ
|
|
$byType = [];
|
|
foreach ($issues as $issue) {
|
|
$type = $issue['type'];
|
|
if (!isset($byType[$type])) {
|
|
$byType[$type] = [];
|
|
}
|
|
$byType[$type][] = $issue;
|
|
}
|
|
|
|
foreach ($byType as $type => $typeIssues) {
|
|
echo "\n" . str_repeat('-', 80) . "\n";
|
|
echo "Type: " . strtoupper($type) . " (" . count($typeIssues) . " issues)\n";
|
|
echo str_repeat('-', 80) . "\n\n";
|
|
|
|
foreach ($typeIssues as $issue) {
|
|
echo sprintf(
|
|
"Line %d: %s\n",
|
|
$issue['line'],
|
|
$issue['message']
|
|
);
|
|
|
|
if (isset($issue['suggestion'])) {
|
|
echo " 💡 Suggestion: {$issue['suggestion']}\n";
|
|
}
|
|
|
|
echo "\n";
|
|
}
|
|
}
|
|
|
|
echo "\n" . str_repeat('=', 80) . "\n";
|
|
echo "Summary:\n";
|
|
echo " Total issues: " . count($issues) . "\n";
|
|
foreach ($byType as $type => $typeIssues) {
|
|
echo " - {$type}: " . count($typeIssues) . "\n";
|
|
}
|
|
}
|
|
|