Fix backend code styling

This commit is contained in:
MakingCG
2021-11-04 16:38:21 +00:00
committed by GitHub Actions
parent 02582f2ae3
commit 77d14a9d80
3 changed files with 13 additions and 14 deletions
@@ -1,9 +1,8 @@
<?php
namespace Domain\Teams\Actions;
use Domain\Folders\Models\Folder;
use Illuminate\Support\Arr;
use Domain\Folders\Models\Folder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage;
@@ -29,7 +28,8 @@ class TransferContentOwnershipToTeamFolderOwnerAction
->whereIn('parent_id', $teamFolderIds)
->where('user_id', $leavingUserId)
->cursor()
->each(fn ($file) =>
->each(
fn ($file) =>
$this->move_files_to_the_new_destination($file, $folder)
);
@@ -52,21 +52,21 @@ class TransferContentOwnershipToTeamFolderOwnerAction
{
// Move image thumbnails
if ($file->type === 'image') {
// Get image thumbnail list
$thumbnailList = get_thumbnail_file_list($file->basename);
// move thumbnails to the new location
$thumbnailList->each(function ($basename) use ($file, $folder) {
$oldPath = "files/$file->user_id/$basename";
$newPath = "files/$folder->user_id/$basename";
if (Storage::exists($oldPath)) Storage::move($oldPath, $newPath);
if (Storage::exists($oldPath)) {
Storage::move($oldPath, $newPath);
}
});
}
// Move single file
Storage::move("files/$file->user_id/$file->basename", "files/$folder->user_id/$file->basename");
}
}
}
@@ -1,5 +1,4 @@
<?php
namespace Domain\Teams\Controllers;
use Auth;
@@ -15,7 +14,8 @@ class LeaveTeamFolderController extends Controller
{
public function __construct(
public TransferContentOwnershipToTeamFolderOwnerAction $transferContentOwnership,
) {}
) {
}
public function __invoke(Folder $folder): Response|Application|ResponseFactory
{