CompilationResult
The outcome of compiling one ValidatorSource through an emitter: the artifact (null if a fatal diagnostic prevented emission) plus every diagnostic recorded along the way.
A future CLI reports diagnostics and decides the process exit code from this; ValidatorCompiler itself never throws for ordinary (non-crashing) problems in ‘warn’ mode.
Synopsis
Section titled “Synopsis”final class CompilationResult
| Since | 1.0.0 |
| Source | Validator/Compiler/CompilationResult.php |
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
$artifact | ?EmittedArtifact | readonly. |
$diagnostics | array | readonly. |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(?EmittedArtifact $artifact, array<Diagnostic> $diagnostics): mixed
| Parameter | Type | Description |
|---|---|---|
$artifact | ?EmittedArtifact | |
$diagnostics | array``<Diagnostic> |
Returns mixed
Methods
Section titled “Methods”| Method | Description |
|---|---|
hasErrors(): bool | Reports whether any recorded diagnostic is of error severity. |
hasErrors()
Section titled “hasErrors()”public function hasErrors(): bool
Reports whether any recorded diagnostic is of error severity.
Warnings and lesser severities do not count, so a result can carry diagnostics and still answer false. A true here means the artifact, if one was emitted at all, should not be trusted.
Returns bool