Files
rspade_system/app/RSpade/SchemaQuality/SchemaViolation.php
root 29c657f7a7 Exclude tests directory from framework publish
Add 100+ automated unit tests from .expect file specifications
Add session system test
Add rsx:constants:regenerate command test
Add rsx:logrotate command test
Add rsx:clean command test
Add rsx:manifest:stats command test
Add model enum system test
Add model mass assignment prevention test
Add rsx:check command test
Add migrate:status command test

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-25 03:59:58 +00:00

38 lines
1006 B
PHP

<?php
namespace App\RSpade\SchemaQuality;
class SchemaViolation
{
public function __construct(
public string $rule_id,
public string $table,
public ?string $column,
public string $message,
public string $recommendation,
public string $severity = 'high'
) {}
public function to_array(): array
{
return [
'rule_id' => $this->rule_id,
'table' => $this->table,
'column' => $this->column,
'message' => $this->message,
'recommendation' => $this->recommendation,
'severity' => $this->severity,
];
}
public function format_output(): string
{
$output = " ❌ [{$this->rule_id}] Table: {$this->table}";
if ($this->column) {
$output .= ", Column: {$this->column}";
}
$output .= "\n {$this->message}\n";
$output .= " 💡 {$this->recommendation}\n";
return $output;
}
}