diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index 029a377f..b226a139 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -363,7 +363,7 @@ class ConfigurationManager } public function getRegisteredSecret(string $secretId) : string { - if ($this->secrets[$secretId]) { + if (isset($this->secrets[$secretId])) { return $this->getAndGenerateSecret($secretId); } throw new \Exception("The secret " . $secretId . " was not registered. Please check if it is defined in secrets of containers.json."); @@ -563,7 +563,6 @@ class ConfigurationManager $this->set('domain', $domain); // Reset the borg restore password when setting the domain $this->borgRestorePassword = ''; - $this->startTransaction(); $this->commitTransaction(); } diff --git a/php/src/Docker/DockerActionManager.php b/php/src/Docker/DockerActionManager.php index 2edad1ed..940814fe 100644 --- a/php/src/Docker/DockerActionManager.php +++ b/php/src/Docker/DockerActionManager.php @@ -157,11 +157,12 @@ readonly class DockerActionManager { $response = ""; $separator = "\r\n"; $line = strtok($responseBody, $separator); - $response = substr((string)$line, 8) . $separator; + if ($line !== false) { + $response = substr($line, 8) . $separator; + } - while ($line !== false) { - $line = strtok($separator); - $response .= substr((string)$line, 8) . $separator; + while (($line = strtok($separator)) !== false) { + $response .= substr($line, 8) . $separator; } return $response; @@ -187,7 +188,7 @@ readonly class DockerActionManager { ]; if ($volume->name === 'nextcloud_aio_nextcloud_datadir' || $volume->name === 'nextcloud_aio_backupdir') { - return; + continue; } $firstChar = substr($volume->name, 0, 1);