From bc7a09b603d24b9e172931915a5b11ed557aea0c Mon Sep 17 00:00:00 2001 From: Nicolas Widart Date: Tue, 10 Oct 2017 15:23:21 +0200 Subject: [PATCH] Moving the file and folder movers inside their own namespace --- Modules/Media/Http/Controllers/Api/MoveMediaController.php | 6 +++--- Modules/Media/Services/{ => Movers}/FileMover.php | 5 ++--- Modules/Media/Services/{ => Movers}/FolderMover.php | 4 ++-- .../Media/Services/{Mover.php => Movers/MoverInterface.php} | 4 ++-- Modules/Media/Tests/FileMoverTest.php | 2 +- Modules/Media/Tests/FolderMoverTest.php | 2 +- 6 files changed, 11 insertions(+), 12 deletions(-) rename Modules/Media/Services/{ => Movers}/FileMover.php (97%) rename Modules/Media/Services/{ => Movers}/FolderMover.php (97%) rename Modules/Media/Services/{Mover.php => Movers/MoverInterface.php} (62%) diff --git a/Modules/Media/Http/Controllers/Api/MoveMediaController.php b/Modules/Media/Http/Controllers/Api/MoveMediaController.php index d33bbfe3c..fd362b8c4 100644 --- a/Modules/Media/Http/Controllers/Api/MoveMediaController.php +++ b/Modules/Media/Http/Controllers/Api/MoveMediaController.php @@ -7,8 +7,8 @@ use Modules\Media\Http\Requests\MoveMediaRequest; use Modules\Media\Repositories\FileRepository; use Modules\Media\Repositories\FolderRepository; -use Modules\Media\Services\FileMover; -use Modules\Media\Services\FolderMover; +use Modules\Media\Services\Movers\FileMover; +use Modules\Media\Services\Movers\FolderMover; class MoveMediaController extends Controller { @@ -49,7 +49,7 @@ public function __invoke(MoveMediaRequest $request) $failedMoves = 0; foreach ($request->get('files') as $file) { $file = $this->file->find($file['id']); - + // $this->>mover->move($file, $destination) if ($file->is_folder === false) { if ($this->fileMover->move($file, $destination) === false) { $failedMoves++; diff --git a/Modules/Media/Services/FileMover.php b/Modules/Media/Services/Movers/FileMover.php similarity index 97% rename from Modules/Media/Services/FileMover.php rename to Modules/Media/Services/Movers/FileMover.php index cd7fa3c70..52758b2e2 100644 --- a/Modules/Media/Services/FileMover.php +++ b/Modules/Media/Services/Movers/FileMover.php @@ -1,6 +1,6 @@