Lines 0.00% 0 / 3
Functions and Methods 0.00% 0 / 1
Classes and Traits 0.00% 0 / 1
Name Lines Functions and Methods CRAP Classes and Traits
WorkerRestartOutcome 0.00% 0 / 3 0.00% 0 / 1 12 0.00% 0 / 1
 describeForWorker 0.00% 0 / 3 0.00% 0 / 1 12
1<?php
2
3declare(strict_types=1);
4
5namespace Stewart\Runtime\Broker;
6
7use Stewart\Runtime\Model\WorkerId;
8
9enum WorkerRestartOutcome
10{
11    case Begun;
12    case AlreadyUnderway;
13
14    public function describeForWorker(WorkerId $workerId): string
15    {
16        return match ($this) {
17            self::Begun => \sprintf('Worker %d is restarting.', $workerId->value),
18            self::AlreadyUnderway => \sprintf('Worker %d is already starting or stopping.', $workerId->value),
19        };
20    }
21}