Add imports for facades

This commit is contained in:
James Cole
2025-02-23 12:47:04 +01:00
parent 0086a0ddc8
commit f7ad9c56c8
43 changed files with 132 additions and 94 deletions

View File

@@ -36,7 +36,9 @@ use FireflyIII\Services\Internal\Update\CategoryUpdateService;
use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface;
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
/**
* Class CategoryRepository.
@@ -83,8 +85,8 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf
/** @var Category $category */
foreach ($categories as $category) {
\DB::table('category_transaction')->where('category_id', $category->id)->delete();
\DB::table('category_transaction_journal')->where('category_id', $category->id)->delete();
DB::table('category_transaction')->where('category_id', $category->id)->delete();
DB::table('category_transaction_journal')->where('category_id', $category->id)->delete();
RecurrenceTransactionMeta::where('name', 'category_id')->where('value', $category->id)->delete();
RuleAction::where('action_type', 'set_category')->where('action_value', $category->name)->delete();
$category->delete();
@@ -237,8 +239,7 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf
{
$set = $category->attachments()->get();
/** @var \Storage $disk */
$disk = \Storage::disk('upload');
$disk = Storage::disk('upload');
return $set->each(
static function (Attachment $attachment) use ($disk) { // @phpstan-ignore-line