diff --git a/php/src/Auth/AuthManager.php b/php/src/Auth/AuthManager.php index 925ff89f..ad4b2ebd 100644 --- a/php/src/Auth/AuthManager.php +++ b/php/src/Auth/AuthManager.php @@ -30,7 +30,7 @@ readonly class AuthManager { $_SESSION['date_time'] = $dateTime; $df = disk_free_space(DataConst::GetSessionDirectory()); - if ($df !== false && (int)$df < 10240) { + if ($df !== false && intval($df) < 10240) { error_log(DataConst::GetSessionDirectory() . " has only less than 10KB free space. The login might not succeed because of that!"); } diff --git a/php/src/Cron/CheckFreeDiskSpace.php b/php/src/Cron/CheckFreeDiskSpace.php index b462195e..e83c46f4 100644 --- a/php/src/Cron/CheckFreeDiskSpace.php +++ b/php/src/Cron/CheckFreeDiskSpace.php @@ -20,7 +20,7 @@ $id = 'nextcloud-aio-nextcloud'; $nextcloudContainer = $containerDefinitionFetcher->GetContainerById($id); $df = disk_free_space(DataConst::GetDataDirectory()); -if ($df !== false && (int)$df < 1024 * 1024 * 1024 * 5) { +if ($df !== false && intval($df) < 1024 * 1024 * 1024 * 5) { error_log("The drive that hosts the mastercontainer volume has less than 5 GB free space. Container updates and backups might not succeed due to that!"); $dockerActionManger->sendNotification($nextcloudContainer, 'Low on space!', 'The drive that hosts the mastercontainer volume has less than 5 GB free space. Container updates and backups might not succeed due to that!'); } diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index 320bc477..b605c94b 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -606,7 +606,7 @@ class ConfigurationManager $df = disk_free_space(DataConst::GetDataDirectory()); $content = json_encode($config, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR); $size = strlen($content) + 10240; - if ($df !== false && (int)$df < $size) { + if ($df !== false && intval($df) < $size) { throw new InvalidSettingConfigurationException(DataConst::GetDataDirectory() . " does not have enough space for writing the config file! Not writing it back!"); } file_put_contents(DataConst::GetConfigFile(), $content); @@ -710,7 +710,7 @@ class ConfigurationManager } public function GetApacheMaxSize() : int { - $uploadLimit = (int)rtrim($this->GetNextcloudUploadLimit(), 'G'); + $uploadLimit = intval(rtrim($this->GetNextcloudUploadLimit(), 'G')); return $uploadLimit * 1024 * 1024 * 1024; } diff --git a/php/src/Docker/DockerActionManager.php b/php/src/Docker/DockerActionManager.php index 9e8a8ff2..02a86deb 100644 --- a/php/src/Docker/DockerActionManager.php +++ b/php/src/Docker/DockerActionManager.php @@ -121,7 +121,7 @@ readonly class DockerActionManager { } if ($internalPort !== "" && $internalPort !== 'host') { - $connection = @fsockopen($containerName, (int)$internalPort, $errno, $errstr, 0.2); + $connection = @fsockopen($containerName, intval($internalPort), $errno, $errstr, 0.2); if ($connection) { fclose($connection); return ContainerState::Running;