From f29a3d58e7646068ec678d0d20d9acb49a67110c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Apr 2026 20:05:35 +0000 Subject: [PATCH] Extract getLatestMajorVersion() to avoid duplicating the version string Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/d5ec921f-8629-4f6e-949a-e8f89f1eb85f Co-authored-by: szaimen <42591237+szaimen@users.noreply.github.com> --- php/src/Controller/DockerController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/php/src/Controller/DockerController.php b/php/src/Controller/DockerController.php index 3def143b..f515dd3c 100644 --- a/php/src/Controller/DockerController.php +++ b/php/src/Controller/DockerController.php @@ -15,6 +15,10 @@ use Slim\Psr7\NonBufferedBody; readonly class DockerController { private const string TOP_CONTAINER = 'nextcloud-aio-apache'; + private function getLatestMajorVersion(): string { + return '33'; + } + public function __construct( private DockerActionManager $dockerActionManager, private ContainerDefinitionFetcher $containerDefinitionFetcher, @@ -221,7 +225,7 @@ readonly class DockerController { } if (isset($request->getParsedBody()['install_latest_major'])) { - $installLatestMajor = '33'; + $installLatestMajor = $this->getLatestMajorVersion(); } else { $installLatestMajor = ''; } @@ -329,7 +333,7 @@ readonly class DockerController { } public function RunNextcloudUpgradeToLatestMajor(Request $request, Response $response, array $args) : Response { - $this->configurationManager->installLatestMajor = '33'; + $this->configurationManager->installLatestMajor = $this->getLatestMajorVersion(); // Get streaming response start and closure $nonbufResp = $this->startStreamingResponse($response);