Lines 0.00% 0 / 4
Functions and Methods 0.00% 0 / 1
Classes and Traits 0.00% 0 / 1
Name Lines Functions and Methods CRAP Classes and Traits
AppPauseOverridePersistence 0.00% 0 / 4 0.00% 0 / 1 20 0.00% 0 / 1
 findWarning 0.00% 0 / 4 0.00% 0 / 1 20
1<?php
2
3declare(strict_types=1);
4
5namespace Stewart\Runtime\Lifecycle;
6
7enum AppPauseOverridePersistence
8{
9    case Stored;
10    case NotConfigured;
11    case Failed;
12
13    public function findWarning(): ?string
14    {
15        return match ($this) {
16            self::Stored => null,
17            self::NotConfigured => 'Not saved: persistence.url is not set, so this lasts until the daemon restarts.',
18            self::Failed => 'Not saved: the store did not take the change, so it lasts until the daemon restarts; run the command again once the store is back.',
19        };
20    }
21}