mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 14:36:52 +00:00
Add Enum
Signed-off-by: Jean-Yves <7360784+docjyJ@users.noreply.github.com>
This commit is contained in:
parent
a54cfed53d
commit
a0ec043c49
16 changed files with 60 additions and 104 deletions
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace AIO\Container;
|
||||
|
||||
use AIO\Container\State\IContainerState;
|
||||
use AIO\Data\ConfigurationManager;
|
||||
use AIO\Docker\DockerActionManager;
|
||||
use AIO\ContainerDefinitionFetcher;
|
||||
|
|
@ -113,19 +112,19 @@ readonly class Container {
|
|||
return $this->volumes;
|
||||
}
|
||||
|
||||
public function GetRunningState() : IContainerState {
|
||||
public function GetRunningState() : WorkingState {
|
||||
return $this->dockerActionManager->GetContainerRunningState($this);
|
||||
}
|
||||
|
||||
public function GetRestartingState() : IContainerState {
|
||||
public function GetRestartingState() : WorkingState {
|
||||
return $this->dockerActionManager->GetContainerRestartingState($this);
|
||||
}
|
||||
|
||||
public function GetUpdateState() : IContainerState {
|
||||
public function GetUpdateState() : VersionState {
|
||||
return $this->dockerActionManager->GetContainerUpdateState($this);
|
||||
}
|
||||
|
||||
public function GetStartingState() : IContainerState {
|
||||
public function GetStartingState() : WorkingState {
|
||||
return $this->dockerActionManager->GetContainerStartingState($this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace AIO\Container\State;
|
||||
|
||||
interface IContainerState {}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace AIO\Container\State;
|
||||
|
||||
class ImageDoesNotExistState implements IContainerState
|
||||
{}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace AIO\Container\State;
|
||||
|
||||
class NotRestartingState implements IContainerState
|
||||
{}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace AIO\Container\State;
|
||||
|
||||
class RestartingState implements IContainerState
|
||||
{}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace AIO\Container\State;
|
||||
|
||||
class RunningState implements IContainerState
|
||||
{}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace AIO\Container\State;
|
||||
|
||||
class StartingState implements IContainerState
|
||||
{}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace AIO\Container\State;
|
||||
|
||||
class StoppedState implements IContainerState
|
||||
{}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace AIO\Container\State;
|
||||
|
||||
class VersionDifferentState implements IContainerState
|
||||
{}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace AIO\Container\State;
|
||||
|
||||
class VersionEqualState implements IContainerState
|
||||
{}
|
||||
8
php/src/Container/VersionState.php
Normal file
8
php/src/Container/VersionState.php
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace AIO\Container;
|
||||
|
||||
enum VersionState: string {
|
||||
case Different = 'different';
|
||||
case Equal = 'equal';
|
||||
}
|
||||
12
php/src/Container/WorkingState.php
Normal file
12
php/src/Container/WorkingState.php
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace AIO\Container;
|
||||
|
||||
enum WorkingState: string {
|
||||
case ImageDoesNotExist = 'image_does_not_exist';
|
||||
case NotRestarting = 'not_restarting';
|
||||
case Restarting = 'restarting';
|
||||
case Running = 'running';
|
||||
case Starting = 'starting';
|
||||
case Stopped = 'stopped';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue