From 7cf72b9f1d20a42b25b6ef79d96700d9392bcc78 Mon Sep 17 00:00:00 2001 From: Darko Gjorgjijoski Date: Sat, 11 Apr 2026 12:30:00 +0200 Subject: [PATCH] refactor(services): move Updater to app/Support/Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updater is a pure static procedural class — all eight public methods (checkForUpdate, download, unzip, copyFiles, deleteFiles, cleanStaleFiles, migrateUpdate, finishUpdate) are static, there's no constructor, no DI, no instance state. It's stateless self-update plumbing, same character as the Setup/ helpers that moved to Support/ in commit 6d1816bd. Moving it out of Services/ leaves Services/ exclusively for DI-injected classes with real business logic, which is the contract the reorg was aiming for. Update/ now lives next to Setup/ in Support/ where the other install/upgrade-time utilities live. Only 3 consumers needed touching: UpdateController, UpdateCommand, and a reference in config/invoiceshelf.php's comment. 350 tests still pass. --- app/Console/Commands/UpdateCommand.php | 2 +- app/Http/Controllers/Admin/UpdateController.php | 2 +- app/{Services => Support}/Update/Updater.php | 2 +- config/invoiceshelf.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename app/{Services => Support}/Update/Updater.php (99%) diff --git a/app/Console/Commands/UpdateCommand.php b/app/Console/Commands/UpdateCommand.php index 15f24c1d..13e897a7 100644 --- a/app/Console/Commands/UpdateCommand.php +++ b/app/Console/Commands/UpdateCommand.php @@ -2,7 +2,7 @@ namespace App\Console\Commands; -use App\Services\Update\Updater; +use App\Support\Update\Updater; use Illuminate\Console\Command; use Illuminate\Support\Facades\File; diff --git a/app/Http/Controllers/Admin/UpdateController.php b/app/Http/Controllers/Admin/UpdateController.php index a66ece2e..16b3a28b 100644 --- a/app/Http/Controllers/Admin/UpdateController.php +++ b/app/Http/Controllers/Admin/UpdateController.php @@ -3,7 +3,7 @@ namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; -use App\Services\Update\Updater; +use App\Support\Update\Updater; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; use Illuminate\Support\Facades\File; diff --git a/app/Services/Update/Updater.php b/app/Support/Update/Updater.php similarity index 99% rename from app/Services/Update/Updater.php rename to app/Support/Update/Updater.php index 26c9870b..219df083 100644 --- a/app/Services/Update/Updater.php +++ b/app/Support/Update/Updater.php @@ -1,6 +1,6 @@