websign-dev/sillbeam-core · v0.3.0

ArchitectureReport

\Sillbeam\Core\Architecture · class

Type information

\Sillbeam\Core\Architecture\ArchitectureReport

Scalar architecture report shared by text, JSON and Markdown command output.

Schema version 1 represents valid, violations or unavailable status. Presentation data is a separate internal view and is never serialized by toJson().

Methods (6)

__construct()

\Sillbeam\Core\Architecture\ArchitectureReport::__construct()

Stores a schema-versioned scalar report; callers normally use fromAnalysis() or unavailable().

public function __construct(public array $data, /** @internal Scalar view used only by Core renderers. */ public array $presentation = [])

collect()

\Sillbeam\Core\Architecture\ArchitectureReport::collect()

Evaluates a report provider while suppressing incidental output.

Temporarily buffers output and installs an error handler: enabled warnings become exceptions, notices/deprecations are suppressed. Any Throwable becomes an unavailable report. Restores the previous handler and closes added buffers in all cases.

public static function collect(self|\Closure $provider): self

exitCode()

\Sillbeam\Core\Architecture\ArchitectureReport::exitCode()

Maps report status to CLI success (0), architecture violations (1) or unavailable (2).

public function exitCode(): int

fromAnalysis()

\Sillbeam\Core\Architecture\ArchitectureReport::fromAnalysis()

Builds a stable schema-version-1 report, retaining available evidence on invalid/incomplete analysis.

Unknown activation is represented as null rather than an inactive module.

public static function fromAnalysis(ArchitectureAnalysisResult $analysis, array $config = [], ?string $projectDir = null): self

toJson()

\Sillbeam\Core\Architecture\ArchitectureReport::toJson()

Serializes only schema data as pretty JSON, keeping finding context as an object.

Invalid UTF-8 is substituted; the internal presentation view is omitted.

public function toJson(): string

unavailable()

\Sillbeam\Core\Architecture\ArchitectureReport::unavailable()

Converts an execution failure into a fatal report.execution finding with unavailable status.

public static function unavailable(\Throwable $error): self

Properties (1)

$data

\Sillbeam\Core\Architecture\ArchitectureReport::$data