Files
michaelschiemer/tests/debug/test-component-linter.php
2025-11-24 21:28:25 +01:00

40 lines
925 B
PHP

<?php
declare(strict_types=1);
require_once __DIR__ . '/../../vendor/autoload.php';
use App\Framework\View\Linting\ComponentLinter;
$linter = new ComponentLinter();
// Test mit einem Template das noch alte Syntax hat
$testFile = __DIR__ . '/../../src/Application/Admin/templates/database/table-detail.view.php';
echo "Testing ComponentLinter on: $testFile\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";
foreach ($issues as $issue) {
echo sprintf(
"Line %d: [%s] %s\n",
$issue['line'],
strtoupper($issue['type']),
$issue['message']
);
if (isset($issue['suggestion'])) {
echo " 💡 Suggestion: {$issue['suggestion']}\n";
}
echo "\n";
}
}