CaseActivities/CaseAutomation sind Fassaden über ProcessRunner. Verhaltensvergleich v0.11: 11 Abläufe und 198 Konstellationen gleich, beabsichtigte Abweichungen I-004/I-005 (F-001/F-002). Volle Suite vor U-B: 785/785. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
45 lines
999 B
PHP
45 lines
999 B
PHP
<?php
|
|
|
|
namespace App\Process;
|
|
|
|
/**
|
|
* What happened when the runner carried out one step: it ran (the action did its work), it was held back (with the
|
|
* reasons, shown to the landlord as before) or it failed technically.
|
|
*/
|
|
final readonly class StepResult
|
|
{
|
|
public const RAN = 'ran';
|
|
|
|
public const BLOCKED = 'blocked';
|
|
|
|
public const FAILED = 'failed';
|
|
|
|
/**
|
|
* @param list<string> $reasons
|
|
*/
|
|
private function __construct(public string $outcome, public array $reasons = []) {}
|
|
|
|
public static function ran(): self
|
|
{
|
|
return new self(self::RAN);
|
|
}
|
|
|
|
/**
|
|
* @param list<string> $reasons
|
|
*/
|
|
public static function blocked(array $reasons): self
|
|
{
|
|
return new self(self::BLOCKED, array_values($reasons));
|
|
}
|
|
|
|
public static function failed(string $reason): self
|
|
{
|
|
return new self(self::FAILED, [$reason]);
|
|
}
|
|
|
|
public function didRun(): bool
|
|
{
|
|
return $this->outcome === self::RAN;
|
|
}
|
|
}
|