28 lines
678 B
PHP
28 lines
678 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace App\Support\Architecture;
|
|
|
|
final readonly class ArchitectureViolation
|
|
{
|
|
public function __construct(
|
|
public string $ruleId,
|
|
public string $severity,
|
|
public string $file,
|
|
public int $line,
|
|
public string $message,
|
|
public ?string $suggestedFix = null,
|
|
) {}
|
|
|
|
public function toArray(): array
|
|
{
|
|
return [
|
|
'rule_id' => $this->ruleId,
|
|
'severity' => $this->severity,
|
|
'file' => $this->file,
|
|
'line' => $this->line,
|
|
'message' => $this->message,
|
|
'suggested_fix' => $this->suggestedFix,
|
|
];
|
|
}
|
|
}
|