mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-09-14 02:24:52 +08:00
fix some psalm issues
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
parent
23429f3e59
commit
edb8bd228b
4 changed files with 18 additions and 23 deletions
|
@ -6,7 +6,7 @@ class ContainerVolumes {
|
|||
/** @var ContainerVolume[] */
|
||||
private array $volumes = [];
|
||||
|
||||
public function AddVolume(ContainerVolume $volume) {
|
||||
public function AddVolume(ContainerVolume $volume) : void {
|
||||
$this->volumes[] = $volume;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ class DockerController
|
|||
$this->configurationManager = $configurationManager;
|
||||
}
|
||||
|
||||
private function PerformRecursiveContainerStart(string $id) {
|
||||
private function PerformRecursiveContainerStart(string $id) : void {
|
||||
$container = $this->containerDefinitionFetcher->GetContainerById($id);
|
||||
|
||||
foreach($container->GetDependsOn() as $dependency) {
|
||||
|
@ -126,7 +126,7 @@ class DockerController
|
|||
return $response->withStatus(201)->withHeader('Location', '/');
|
||||
}
|
||||
|
||||
private function PerformRecursiveContainerStop(string $id)
|
||||
private function PerformRecursiveContainerStop(string $id) : void
|
||||
{
|
||||
$container = $this->containerDefinitionFetcher->GetContainerById($id);
|
||||
foreach($container->GetDependsOn() as $dependency) {
|
||||
|
@ -146,7 +146,7 @@ class DockerController
|
|||
return $response->withStatus(201)->withHeader('Location', '/');
|
||||
}
|
||||
|
||||
public function StartDomaincheckContainer()
|
||||
public function StartDomaincheckContainer() : void
|
||||
{
|
||||
# Don't start if domain is already set
|
||||
if ($this->configurationManager->GetDomain() != '') {
|
||||
|
@ -167,7 +167,7 @@ class DockerController
|
|||
$this->PerformRecursiveContainerStart($id);
|
||||
}
|
||||
|
||||
private function StopDomaincheckContainer()
|
||||
private function StopDomaincheckContainer() : void
|
||||
{
|
||||
$id = 'nextcloud-aio-domaincheck';
|
||||
$this->PerformRecursiveContainerStop($id);
|
||||
|
|
|
@ -46,7 +46,7 @@ class ConfigurationManager
|
|||
return $config['secrets'][$secretId];
|
||||
}
|
||||
|
||||
private function DoubleSafeBackupSecret(string $borgBackupPassword) {
|
||||
private function DoubleSafeBackupSecret(string $borgBackupPassword) : void {
|
||||
file_put_contents(DataConst::GetBackupSecretFile(), $borgBackupPassword);
|
||||
}
|
||||
|
||||
|
@ -101,10 +101,6 @@ class ConfigurationManager
|
|||
$backupTimes[] = $backupTimesTemp[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_array($backupTimes)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return $backupTimes;
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ class DockerActionManager
|
|||
}
|
||||
}
|
||||
|
||||
public function DeleteContainer(Container $container) {
|
||||
public function DeleteContainer(Container $container) : void {
|
||||
$url = $this->BuildApiUrl(sprintf('containers/%s?v=true', urlencode($container->GetIdentifier())));
|
||||
try {
|
||||
$this->guzzleClient->delete($url);
|
||||
|
@ -142,12 +142,12 @@ class DockerActionManager
|
|||
return $response;
|
||||
}
|
||||
|
||||
public function StartContainer(Container $container) {
|
||||
public function StartContainer(Container $container) : void {
|
||||
$url = $this->BuildApiUrl(sprintf('containers/%s/start', urlencode($container->GetIdentifier())));
|
||||
$this->guzzleClient->post($url);
|
||||
}
|
||||
|
||||
public function CreateVolumes(Container $container)
|
||||
public function CreateVolumes(Container $container): void
|
||||
{
|
||||
$url = $this->BuildApiUrl('volumes/create');
|
||||
foreach($container->GetVolumes()->GetVolumes() as $volume) {
|
||||
|
@ -170,7 +170,7 @@ class DockerActionManager
|
|||
}
|
||||
}
|
||||
|
||||
public function CreateContainer(Container $container) {
|
||||
public function CreateContainer(Container $container) : void {
|
||||
$volumes = [];
|
||||
foreach($container->GetVolumes()->GetVolumes() as $volume) {
|
||||
$volumeEntry = $volume->name . ':' . $volume->mountPoint;
|
||||
|
@ -259,7 +259,7 @@ class DockerActionManager
|
|||
);
|
||||
}
|
||||
|
||||
public function PullContainer(Container $container)
|
||||
public function PullContainer(Container $container) : void
|
||||
{
|
||||
$url = $this->BuildApiUrl(sprintf('images/create?fromImage=%s', urlencode($this->BuildImageName($container))));
|
||||
try {
|
||||
|
@ -283,10 +283,9 @@ class DockerActionManager
|
|||
return $updateAvailable;
|
||||
}
|
||||
|
||||
public function isAnyUpdateAvailable() {
|
||||
public function isAnyUpdateAvailable() : bool {
|
||||
$id = 'nextcloud-aio-apache';
|
||||
|
||||
|
||||
if ($this->isContainerUpdateAvailable($id) !== "") {
|
||||
return true;
|
||||
} else {
|
||||
|
@ -354,7 +353,7 @@ class DockerActionManager
|
|||
}
|
||||
}
|
||||
|
||||
public function sendNotification(Container $container, string $subject, string $message)
|
||||
public function sendNotification(Container $container, string $subject, string $message) : void
|
||||
{
|
||||
if ($this->GetContainerStartingState($container) instanceof RunningState) {
|
||||
|
||||
|
@ -400,7 +399,7 @@ class DockerActionManager
|
|||
}
|
||||
}
|
||||
|
||||
public function DisconnectContainerFromNetwork(Container $container)
|
||||
public function DisconnectContainerFromNetwork(Container $container) : void
|
||||
{
|
||||
|
||||
$url = $this->BuildApiUrl(
|
||||
|
@ -421,7 +420,7 @@ class DockerActionManager
|
|||
}
|
||||
}
|
||||
|
||||
private function ConnectContainerIdToNetwork(string $id)
|
||||
private function ConnectContainerIdToNetwork(string $id) : void
|
||||
{
|
||||
$url = $this->BuildApiUrl('networks/create');
|
||||
try {
|
||||
|
@ -464,17 +463,17 @@ class DockerActionManager
|
|||
}
|
||||
}
|
||||
|
||||
public function ConnectMasterContainerToNetwork()
|
||||
public function ConnectMasterContainerToNetwork() : void
|
||||
{
|
||||
$this->ConnectContainerIdToNetwork('nextcloud-aio-mastercontainer');
|
||||
}
|
||||
|
||||
public function ConnectContainerToNetwork(Container $container)
|
||||
public function ConnectContainerToNetwork(Container $container) : void
|
||||
{
|
||||
$this->ConnectContainerIdToNetwork($container->GetIdentifier());
|
||||
}
|
||||
|
||||
public function StopContainer(Container $container) {
|
||||
public function StopContainer(Container $container) : void {
|
||||
$url = $this->BuildApiUrl(sprintf('containers/%s/stop?t=%s', urlencode($container->GetIdentifier()), $container->GetMaxShutdownTime()));
|
||||
try {
|
||||
$this->guzzleClient->post($url);
|
||||
|
|
Loading…
Add table
Reference in a new issue