}> */ public array $calls = []; public function __construct( private readonly ?ExchangePowerShellCommandContracts $contracts = null, ) {} /** * @param array $parameters * @param list> $items * @return array */ public function run(mixed $contract, array $parameters = [], array $items = []): array { $contracts = $this->contracts ?? new ExchangePowerShellCommandContracts; $validation = $contracts->validateInvocation($contract, $parameters); if (! $validation['accepted']) { return [ 'ok' => false, 'reason_code' => $validation['reason_code'], 'source' => 'spec430_fake_exchange_powershell_runner', 'shell_executed' => false, 'provider_call_executed' => false, ]; } $this->calls[] = [ 'command_name' => (string) $contract['command_name'], 'parameters' => $parameters, ]; return [ 'ok' => true, 'reason_code' => null, 'source' => 'spec430_fake_exchange_powershell_runner', 'command_name' => (string) $contract['command_name'], 'items' => $items, 'shell_executed' => false, 'provider_call_executed' => false, ]; } }