From 11baa97ef62066e99d7f88ca525b1bc6a9456613 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 29 Apr 2024 12:04:32 +0200 Subject: [PATCH] Refactor services.php file to improve variable replacement logic --- bootstrap/helpers/services.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap/helpers/services.php b/bootstrap/helpers/services.php index 8e3c0337e..26a69222a 100644 --- a/bootstrap/helpers/services.php +++ b/bootstrap/helpers/services.php @@ -18,7 +18,7 @@ function collectRegex(string $name) } function replaceVariables($variable) { - return $variable->replaceFirst('$', '')->replaceFirst('{', '')->replaceLast('}', ''); + return $variable->before('}')->replaceFirst('$', '')->replaceFirst('{', ''); } function getFilesystemVolumesFromServer(ServiceApplication|ServiceDatabase|Application $oneService, bool $isInit = false) @@ -27,7 +27,7 @@ function getFilesystemVolumesFromServer(ServiceApplication|ServiceDatabase|Appli if ($oneService->getMorphClass() === 'App\Models\Application') { $workdir = $oneService->workdir(); $server = $oneService->destination->server; - } else{ + } else { $workdir = $oneService->service->workdir(); $server = $oneService->service->server; }