From da202317c0125aecf0684838a3871ac3e00e0ea1 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 26 Apr 2016 21:40:15 +0200 Subject: [PATCH] Code cleanup. --- .../Commands/UpgradeFireflyInstructions.php | 6 +- app/Console/Kernel.php | 1 - app/Export/Entry/EntryAccount.php | 14 ++--- app/Export/Entry/EntryBill.php | 6 +- app/Export/Entry/EntryBudget.php | 6 +- app/Export/Entry/EntryCategory.php | 6 +- app/Export/Exporter/CsvExporter.php | 8 +-- app/Export/Processor.php | 21 +++++-- .../Chart/Bill/ChartJsBillChartGenerator.php | 10 +--- .../Budget/ChartJsBudgetChartGenerator.php | 3 +- .../ChartJsCategoryChartGenerator.php | 14 +---- app/Handlers/Events/UserConfirmation.php | 12 ---- app/Helpers/Attachments/AttachmentHelper.php | 59 ++++++++++++------- app/Helpers/Csv/Importer.php | 9 ++- app/Helpers/Csv/Wizard.php | 5 +- app/Helpers/Report/BalanceReportHelper.php | 56 +++++++++--------- app/Http/Controllers/AccountController.php | 19 +++--- .../Auth/ConfirmationController.php | 5 +- app/Http/Controllers/BillController.php | 5 +- app/Http/Controllers/BudgetController.php | 2 - .../Controllers/Chart/CategoryController.php | 2 +- app/Http/Controllers/CsvController.php | 7 +-- app/Http/Controllers/ExportController.php | 5 +- app/Http/Controllers/HomeController.php | 12 ++-- app/Http/Controllers/JsonController.php | 5 +- app/Http/Controllers/NewUserController.php | 3 +- app/Http/Controllers/PiggyBankController.php | 5 +- .../Controllers/PreferencesController.php | 3 +- app/Http/Controllers/RuleController.php | 5 +- .../Controllers/TransactionController.php | 5 +- app/Http/Requests/AccountFormRequest.php | 7 +-- app/Http/Requests/RuleFormRequest.php | 7 +-- app/Http/Requests/TestRuleFormRequest.php | 3 +- app/Http/breadcrumbs.php | 4 +- app/Providers/AppServiceProvider.php | 3 +- .../Account/AccountRepository.php | 3 +- app/Repositories/Budget/BudgetRepository.php | 3 +- .../RuleGroupRepositoryInterface.php | 4 +- .../Tag/TagRepositoryInterface.php | 1 - .../User/UserRepositoryInterface.php | 2 +- app/Support/Domain.php | 8 +-- 41 files changed, 167 insertions(+), 197 deletions(-) diff --git a/app/Console/Commands/UpgradeFireflyInstructions.php b/app/Console/Commands/UpgradeFireflyInstructions.php index b15d3c4936..387e0b087c 100644 --- a/app/Console/Commands/UpgradeFireflyInstructions.php +++ b/app/Console/Commands/UpgradeFireflyInstructions.php @@ -3,7 +3,6 @@ declare(strict_types = 1); namespace FireflyIII\Console\Commands; -use Config; use Illuminate\Console\Command; /** @@ -43,8 +42,9 @@ class UpgradeFireflyInstructions extends Command public function handle() { // - $version = Config::get('firefly.version'); - $config = Config::get('upgrade.text'); + /** @var string $version */ + $version = config('firefly.version'); + $config = config('upgrade.text'); $text = $config[$version] ?? null; $this->line('+------------------------------------------------------------------------------+'); diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 8eedc53bf6..806161e922 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -13,7 +13,6 @@ namespace FireflyIII\Console; use FireflyIII\Console\Commands\UpgradeFireflyInstructions; use FireflyIII\Console\Commands\VerifyDatabase; -use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; /** diff --git a/app/Export/Entry/EntryAccount.php b/app/Export/Entry/EntryAccount.php index f12bc6fd43..256d33ecc6 100644 --- a/app/Export/Entry/EntryAccount.php +++ b/app/Export/Entry/EntryAccount.php @@ -18,10 +18,10 @@ use FireflyIII\Models\Account; */ class EntryAccount { + /** @var int */ + public $accountId; /** @var string */ public $iban; - /** @var int */ - public $id; /** @var string */ public $name; /** @var int */ @@ -36,10 +36,10 @@ class EntryAccount */ public function __construct(Account $account) { - $this->id = $account->id; - $this->name = $account->name; - $this->iban = $account->iban; - $this->type = $account->accountType->type; - $this->number = $account->getMeta('accountNumber'); + $this->accountId = $account->id; + $this->name = $account->name; + $this->iban = $account->iban; + $this->type = $account->accountType->type; + $this->number = $account->getMeta('accountNumber'); } } \ No newline at end of file diff --git a/app/Export/Entry/EntryBill.php b/app/Export/Entry/EntryBill.php index 2612ec081b..c5543c4227 100644 --- a/app/Export/Entry/EntryBill.php +++ b/app/Export/Entry/EntryBill.php @@ -19,7 +19,7 @@ use FireflyIII\Models\Bill; class EntryBill { /** @var string */ - public $id = ''; + public $billId = ''; /** @var string */ public $name = ''; @@ -31,8 +31,8 @@ class EntryBill public function __construct(Bill $bill = null) { if (!is_null($bill)) { - $this->id = $bill->id; - $this->name = $bill->name; + $this->billId = $bill->id; + $this->name = $bill->name; } } diff --git a/app/Export/Entry/EntryBudget.php b/app/Export/Entry/EntryBudget.php index 7558537431..5d85358da7 100644 --- a/app/Export/Entry/EntryBudget.php +++ b/app/Export/Entry/EntryBudget.php @@ -19,7 +19,7 @@ use FireflyIII\Models\Budget; class EntryBudget { /** @var string */ - public $id = ''; + public $budgetId = ''; /** @var string */ public $name = ''; @@ -31,8 +31,8 @@ class EntryBudget public function __construct(Budget $budget = null) { if (!is_null($budget)) { - $this->id = $budget->id; - $this->name = $budget->name; + $this->budgetId = $budget->id; + $this->name = $budget->name; } } diff --git a/app/Export/Entry/EntryCategory.php b/app/Export/Entry/EntryCategory.php index dae5791af6..7fbb9834d5 100644 --- a/app/Export/Entry/EntryCategory.php +++ b/app/Export/Entry/EntryCategory.php @@ -19,7 +19,7 @@ use FireflyIII\Models\Category; class EntryCategory { /** @var string */ - public $id = ''; + public $categoryId = ''; /** @var string */ public $name = ''; @@ -31,8 +31,8 @@ class EntryCategory public function __construct(Category $category = null) { if (!is_null($category)) { - $this->id = $category->id; - $this->name = $category->name; + $this->categoryId = $category->id; + $this->name = $category->name; } } } \ No newline at end of file diff --git a/app/Export/Exporter/CsvExporter.php b/app/Export/Exporter/CsvExporter.php index df7d0d5b44..066bc47dd5 100644 --- a/app/Export/Exporter/CsvExporter.php +++ b/app/Export/Exporter/CsvExporter.php @@ -69,10 +69,10 @@ class CsvExporter extends BasicExporter implements ExporterInterface foreach ($this->getEntries() as $entry) { // order is defined in Entry::getFieldsAndTypes. $rows[] = [ - $entry->description, $entry->amount, $entry->date, $entry->sourceAccount->id, $entry->sourceAccount->name, $entry->sourceAccount->iban, - $entry->sourceAccount->type, $entry->sourceAccount->number, $entry->destinationAccount->id, $entry->destinationAccount->name, - $entry->destinationAccount->iban, $entry->destinationAccount->type, $entry->destinationAccount->number, $entry->budget->id, - $entry->budget->name, $entry->category->id, $entry->category->name, $entry->bill->id, $entry->bill->name, + $entry->description, $entry->amount, $entry->date, $entry->sourceAccount->accountId, $entry->sourceAccount->name, $entry->sourceAccount->iban, + $entry->sourceAccount->type, $entry->sourceAccount->number, $entry->destinationAccount->accountId, $entry->destinationAccount->name, + $entry->destinationAccount->iban, $entry->destinationAccount->type, $entry->destinationAccount->number, $entry->budget->budgetId, + $entry->budget->name, $entry->category->categoryId, $entry->category->name, $entry->bill->billId, $entry->bill->name, ]; } diff --git a/app/Export/Processor.php b/app/Export/Processor.php index 46757891b8..a9aeec89ee 100644 --- a/app/Export/Processor.php +++ b/app/Export/Processor.php @@ -11,12 +11,12 @@ declare(strict_types = 1); namespace FireflyIII\Export; use Auth; -use Config; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Export\Entry\Entry; use FireflyIII\Models\ExportJob; use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Journal\JournalCollector; +use Illuminate\Filesystem\FilesystemAdapter; use Illuminate\Support\Collection; use Log; use Storage; @@ -174,10 +174,7 @@ class Processor $zip->close(); // delete the files: - foreach ($this->getFiles() as $file) { - Log::debug('Will now delete file "' . $file . '".'); - $disk->delete($file); - } + $this->deleteFiles($disk); Log::debug('Done!'); return true; @@ -188,7 +185,7 @@ class Processor */ public function exportJournals(): bool { - $exporterClass = Config::get('firefly.export_formats.' . $this->exportFormat); + $exporterClass = config('firefly.export_formats.' . $this->exportFormat); $exporter = app($exporterClass, [$this->job]); Log::debug('Going to export ' . $this->exportEntries->count() . ' export entries into ' . $this->exportFormat . ' format.'); $exporter->setEntries($this->exportEntries); @@ -206,4 +203,16 @@ class Processor { return $this->files; } + + /** + * @param FilesystemAdapter $disk + */ + private function deleteFiles(FilesystemAdapter $disk) + { + Log::debug('Class of $disk: ' . get_class($disk)); + foreach ($this->getFiles() as $file) { + Log::debug('Will now delete file "' . $file . '".'); + $disk->delete($file); + } + } } diff --git a/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php b/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php index 30af6845e1..8462200464 100644 --- a/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php +++ b/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php @@ -54,11 +54,7 @@ class ChartJsBillChartGenerator implements BillChartGeneratorInterface public function single(Bill $bill, Collection $entries): array { $format = (string)trans('config.month'); - $data = [ - 'count' => 3, - 'labels' => [], - 'datasets' => [], - ]; + $data = ['count' => 3, 'labels' => [], 'datasets' => [],]; $minAmount = []; $maxAmount = []; $actualAmount = []; @@ -67,9 +63,7 @@ class ChartJsBillChartGenerator implements BillChartGeneratorInterface $data['labels'][] = $entry->date->formatLocalized($format); $minAmount[] = round($bill->amount_min, 2); $maxAmount[] = round($bill->amount_max, 2); - /* - * journalAmount has been collected in BillRepository::getJournals - */ + // journalAmount has been collected in BillRepository::getJournals $actualAmount[] = round(TransactionJournal::amountPositive($entry), 2); } diff --git a/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php b/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php index 9d4adf812d..8e9ada09ac 100644 --- a/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php +++ b/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php @@ -3,7 +3,6 @@ declare(strict_types = 1); namespace FireflyIII\Generator\Chart\Budget; -use Config; use Illuminate\Support\Collection; use Navigation; use Preferences; @@ -25,7 +24,7 @@ class ChartJsBudgetChartGenerator implements BudgetChartGeneratorInterface public function budgetLimit(Collection $entries, string $dateFormat = 'monthAndDay'): array { $language = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'))->data; - $format = Config::get('firefly.' . $dateFormat . '.' . $language); + $format = config('firefly.' . $dateFormat . '.' . $language); $data = [ 'labels' => [], diff --git a/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php b/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php index 94a1820fd7..9103a5cd31 100644 --- a/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php +++ b/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php @@ -20,8 +20,6 @@ class ChartJsCategoryChartGenerator implements CategoryChartGeneratorInterface */ public function all(Collection $entries): array { - - $data = [ 'count' => 2, 'labels' => [], @@ -116,18 +114,9 @@ class ChartJsCategoryChartGenerator implements CategoryChartGeneratorInterface */ public function multiYear(Collection $entries): array { - // dataset: - $data = [ - 'count' => 0, - 'labels' => [], - 'datasets' => [], - ]; // get labels from one of the categories (assuming there's at least one): $first = $entries->first(); - $keys = array_keys($first['spent']); - foreach ($keys as $year) { - $data['labels'][] = strval($year); - } + $data = ['count' => 0, 'labels' => array_keys($first['spent']), 'datasets' => [],]; // then, loop all entries and create datasets: foreach ($entries as $entry) { @@ -144,7 +133,6 @@ class ChartJsCategoryChartGenerator implements CategoryChartGeneratorInterface $data['count'] = count($data['datasets']); return $data; - } /** diff --git a/app/Handlers/Events/UserConfirmation.php b/app/Handlers/Events/UserConfirmation.php index 588dbd65c6..7415ffeedb 100644 --- a/app/Handlers/Events/UserConfirmation.php +++ b/app/Handlers/Events/UserConfirmation.php @@ -74,11 +74,7 @@ class UserConfirmation private function doConfirm(User $user, string $ipAddress) { Log::debug('Trigger UserConfirmation::doConfirm'); - - // if user must confirm account, send email $confirmAccount = env('MUST_CONFIRM_ACCOUNT', false); - - // otherwise, auto-confirm: if ($confirmAccount === false) { Log::debug('Confirm account is false, so user will be auto-confirmed.'); Preferences::setForUser($user, 'user_confirmed', true); @@ -87,19 +83,12 @@ class UserConfirmation return; } - - // send email message: $email = $user->email; $code = str_random(16); $route = route('do_confirm_account', [$code]); - - // set preferences: Preferences::setForUser($user, 'user_confirmed', false); Preferences::setForUser($user, 'user_confirmed_last_mail', time()); Preferences::setForUser($user, 'user_confirmed_code', $code); - Log::debug('Set preferences for user.'); - - // send email. try { Log::debug('Now in try block for user email message thing to ' . $email . '.'); Mail::send( @@ -109,7 +98,6 @@ class UserConfirmation } ); } catch (Swift_TransportException $e) { - Log::error($e->getMessage()); } catch (Exception $e) { Log::debug('Caught general exception.'); diff --git a/app/Helpers/Attachments/AttachmentHelper.php b/app/Helpers/Attachments/AttachmentHelper.php index d23e74b35f..6fc6e3af0e 100644 --- a/app/Helpers/Attachments/AttachmentHelper.php +++ b/app/Helpers/Attachments/AttachmentHelper.php @@ -3,7 +3,6 @@ declare(strict_types = 1); namespace FireflyIII\Helpers\Attachments; use Auth; -use Config; use Crypt; use FireflyIII\Models\Attachment; use Illuminate\Database\Eloquent\Model; @@ -39,8 +38,8 @@ class AttachmentHelper implements AttachmentHelperInterface */ public function __construct() { - $this->maxUploadSize = Config::get('firefly.maxUploadSize'); - $this->allowedMimes = Config::get('firefly.allowedMimes'); + $this->maxUploadSize = config('firefly.maxUploadSize'); + $this->allowedMimes = config('firefly.allowedMimes'); $this->errors = new MessageBag; $this->messages = new MessageBag; $this->uploadDisk = Storage::disk('upload'); @@ -81,26 +80,14 @@ class AttachmentHelper implements AttachmentHelperInterface */ public function saveAttachmentsForModel(Model $model): bool { - $files = null; - try { - if (Input::hasFile('attachments')) { - $files = Input::file('attachments'); - } - } catch (TypeError $e) { - // Log it, do nothing else. - Log::error($e->getMessage()); + $files = $this->getFiles(); + + if (!is_null($files) && !is_array($files)) { + $this->processFile($files, $model); } if (is_array($files)) { - foreach ($files as $entry) { - if (!is_null($entry)) { - $this->processFile($entry, $model); - } - } - } else { - if (!is_null($files)) { - $this->processFile($files, $model); - } + $this->processFiles($files, $model); } return true; @@ -234,5 +221,37 @@ class AttachmentHelper implements AttachmentHelperInterface return true; } + /** + * @return array|null|UploadedFile + */ + private function getFiles() + { + $files = null; + try { + if (Input::hasFile('attachments')) { + $files = Input::file('attachments'); + } + } catch (TypeError $e) { + // Log it, do nothing else. + Log::error($e->getMessage()); + } + + return $files; + } + + /** + * @param array $files + * + * @return bool + */ + private function processFiles(array $files, Model $model): bool + { + foreach ($files as $entry) { + if (!is_null($entry)) { + $this->processFile($entry, $model); + } + } + } + } diff --git a/app/Helpers/Csv/Importer.php b/app/Helpers/Csv/Importer.php index 78f75a16df..82d05948f6 100644 --- a/app/Helpers/Csv/Importer.php +++ b/app/Helpers/Csv/Importer.php @@ -3,7 +3,6 @@ declare(strict_types = 1); namespace FireflyIII\Helpers\Csv; use Auth; -use Config; use FireflyIII\Events\TransactionJournalStored; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Csv\Converter\ConverterInterface; @@ -219,8 +218,8 @@ class Importer $data = $this->getFiller(); // These fields are necessary to create a new transaction journal. Some are optional foreach ($row as $index => $value) { $role = $this->roles[$index] ?? '_ignore'; - $class = Config::get('csv.roles.' . $role . '.converter'); - $field = Config::get('csv.roles.' . $role . '.field'); + $class = config('csv.roles.' . $role . '.converter'); + $field = config('csv.roles.' . $role . '.field'); Log::debug('Column #' . $index . ' (role: ' . $role . ') : converter ' . $class . ' stores its data into field ' . $field . ':'); @@ -282,7 +281,7 @@ class Importer } - $set = Config::get('csv.post_processors'); + $set = config('csv.post_processors'); foreach ($set as $className) { /** @var PostProcessorInterface $postProcessor */ $postProcessor = app('FireflyIII\Helpers\Csv\PostProcessing\\' . $className); @@ -356,7 +355,7 @@ class Importer private function getFiller() { $filler = []; - foreach (Config::get('csv.roles') as $role) { + foreach (config('csv.roles') as $role) { if (isset($role['field'])) { $fieldName = $role['field']; $filler[$fieldName] = null; diff --git a/app/Helpers/Csv/Wizard.php b/app/Helpers/Csv/Wizard.php index 33d76f0499..ef2a274829 100644 --- a/app/Helpers/Csv/Wizard.php +++ b/app/Helpers/Csv/Wizard.php @@ -3,7 +3,6 @@ declare(strict_types = 1); namespace FireflyIII\Helpers\Csv; use Auth; -use Config; use Crypt; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Csv\Mapper\MapperInterface; @@ -61,7 +60,7 @@ class Wizard implements WizardInterface */ public function processSelectedMapping(array $roles, array $map): array { - $configRoles = Config::get('csv.roles'); + $configRoles = config('csv.roles'); $maps = []; @@ -134,7 +133,7 @@ class Wizard implements WizardInterface $options = []; foreach ($map as $index => $columnRole) { - $mapper = Config::get('csv.roles.' . $columnRole . '.mapper'); + $mapper = config('csv.roles.' . $columnRole . '.mapper'); if (is_null($mapper)) { throw new FireflyException('Cannot map field of type "' . $columnRole . '".'); } diff --git a/app/Helpers/Report/BalanceReportHelper.php b/app/Helpers/Report/BalanceReportHelper.php index 9d919b97ba..ea3ab0e36f 100644 --- a/app/Helpers/Report/BalanceReportHelper.php +++ b/app/Helpers/Report/BalanceReportHelper.php @@ -104,33 +104,33 @@ class BalanceReportHelper implements BalanceReportHelperInterface { $ids = $accounts->pluck('id')->toArray(); $set = Auth::user()->tags() - ->leftJoin('tag_transaction_journal', 'tag_transaction_journal.tag_id', '=', 'tags.id') - ->leftJoin('transaction_journals', 'tag_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id') - ->leftJoin('transaction_types', 'transaction_journals.transaction_type_id', '=', 'transaction_types.id') - ->leftJoin( - 'transactions AS t_source', function (JoinClause $join) { - $join->on('transaction_journals.id', '=', 't_source.transaction_journal_id')->where('t_source.amount', '<', 0); - } - ) - ->leftJoin( - 'transactions AS t_destination', function (JoinClause $join) { - $join->on('transaction_journals.id', '=', 't_destination.transaction_journal_id')->where('t_destination.amount', '>', 0); - } - ) - ->where('tags.tagMode', 'balancingAct') - ->where('transaction_types.type', TransactionType::TRANSFER) - ->where('transaction_journals.date', '>=', $start->format('Y-m-d')) - ->where('transaction_journals.date', '<=', $end->format('Y-m-d')) - ->whereNull('transaction_journals.deleted_at') - ->whereIn('t_source.account_id', $ids) - ->whereIn('t_destination.account_id', $ids) - ->groupBy('t_destination.account_id') - ->get( - [ - 't_destination.account_id', - DB::raw('SUM(`t_destination`.`amount`) as `sum`'), - ] - ); + ->leftJoin('tag_transaction_journal', 'tag_transaction_journal.tag_id', '=', 'tags.id') + ->leftJoin('transaction_journals', 'tag_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id') + ->leftJoin('transaction_types', 'transaction_journals.transaction_type_id', '=', 'transaction_types.id') + ->leftJoin( + 'transactions AS t_source', function (JoinClause $join) { + $join->on('transaction_journals.id', '=', 't_source.transaction_journal_id')->where('t_source.amount', '<', 0); + } + ) + ->leftJoin( + 'transactions AS t_destination', function (JoinClause $join) { + $join->on('transaction_journals.id', '=', 't_destination.transaction_journal_id')->where('t_destination.amount', '>', 0); + } + ) + ->where('tags.tagMode', 'balancingAct') + ->where('transaction_types.type', TransactionType::TRANSFER) + ->where('transaction_journals.date', '>=', $start->format('Y-m-d')) + ->where('transaction_journals.date', '<=', $end->format('Y-m-d')) + ->whereNull('transaction_journals.deleted_at') + ->whereIn('t_source.account_id', $ids) + ->whereIn('t_destination.account_id', $ids) + ->groupBy('t_destination.account_id') + ->get( + [ + 't_destination.account_id', + DB::raw('SUM(`t_destination`.`amount`) as `sum`'), + ] + ); return $set; } @@ -178,7 +178,7 @@ class BalanceReportHelper implements BalanceReportHelperInterface * @param Carbon $start * @param Carbon $end * - * + * * * @return BalanceLine */ diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 969adeb3c3..59abfc1dc2 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -2,7 +2,6 @@ use Auth; use Carbon\Carbon; -use Config; use ExpandedForm; use FireflyIII\Http\Requests\AccountFormRequest; use FireflyIII\Models\Account; @@ -40,7 +39,7 @@ class AccountController extends Controller { - $subTitleIcon = Config::get('firefly.subIconsByIdentifier.' . $what); + $subTitleIcon = config('firefly.subIconsByIdentifier.' . $what); $subTitle = trans('firefly.make_new_' . $what . '_account'); Session::flash('preFilled', []); @@ -64,7 +63,7 @@ class AccountController extends Controller */ public function delete(ARI $repository, Account $account) { - $typeName = Config::get('firefly.shortNamesByFullName.' . $account->accountType->type); + $typeName = config('firefly.shortNamesByFullName.' . $account->accountType->type); $subTitle = trans('firefly.delete_' . $typeName . '_account', ['name' => $account->name]); $accountList = ExpandedForm::makeSelectList($repository->getAccounts([$account->accountType->type]), true); unset($accountList[$account->id]); @@ -86,7 +85,7 @@ class AccountController extends Controller public function destroy(ARI $repository, Account $account) { $type = $account->accountType->type; - $typeName = Config::get('firefly.shortNamesByFullName.' . $type); + $typeName = config('firefly.shortNamesByFullName.' . $type); $name = $account->name; $moveTo = $repository->find(intval(Input::get('move_account_before_delete'))); @@ -107,9 +106,9 @@ class AccountController extends Controller public function edit(ARI $repository, Account $account) { - $what = Config::get('firefly.shortNamesByFullName')[$account->accountType->type]; + $what = config('firefly.shortNamesByFullName')[$account->accountType->type]; $subTitle = trans('firefly.edit_' . $what . '_account', ['name' => $account->name]); - $subTitleIcon = Config::get('firefly.subIconsByIdentifier.' . $what); + $subTitleIcon = config('firefly.subIconsByIdentifier.' . $what); $openingBalance = $repository->openingBalanceTransaction($account); // put previous url in session if not redirect from store (not "return_to_edit"). @@ -155,8 +154,8 @@ class AccountController extends Controller $what = $what ?? 'asset'; $subTitle = trans('firefly.' . $what . '_accounts'); - $subTitleIcon = Config::get('firefly.subIconsByIdentifier.' . $what); - $types = Config::get('firefly.accountTypesByIdentifier.' . $what); + $subTitleIcon = config('firefly.subIconsByIdentifier.' . $what); + $types = config('firefly.accountTypesByIdentifier.' . $what); $accounts = $repository->getAccounts($types); /** @var Carbon $start */ $start = clone session('start', Carbon::now()->startOfMonth()); @@ -190,8 +189,8 @@ class AccountController extends Controller { $page = intval(Input::get('page')) == 0 ? 1 : intval(Input::get('page')); $pageSize = Preferences::get('transactionPageSize', 50)->data; - $subTitleIcon = Config::get('firefly.subTitlesByIdentifier.' . $account->accountType->type); - $what = Config::get('firefly.shortNamesByFullName.' . $account->accountType->type); + $subTitleIcon = config('firefly.subTitlesByIdentifier.' . $account->accountType->type); + $what = config('firefly.shortNamesByFullName.' . $account->accountType->type); $journals = $repository->getJournals($account, $page, $pageSize); $subTitle = trans('firefly.details_for_' . $what, ['name' => $account->name]); $journals->setPath('accounts/show/' . $account->id); diff --git a/app/Http/Controllers/Auth/ConfirmationController.php b/app/Http/Controllers/Auth/ConfirmationController.php index 6832edba8f..790540bf02 100644 --- a/app/Http/Controllers/Auth/ConfirmationController.php +++ b/app/Http/Controllers/Auth/ConfirmationController.php @@ -11,7 +11,6 @@ declare(strict_types = 1); namespace FireflyIII\Http\Controllers\Auth; use Auth; -use Config; use FireflyIII\Events\ResendConfirmation; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; @@ -48,7 +47,7 @@ class ConfirmationController extends Controller $database = Preferences::get('user_confirmed_code')->data; $time = Preferences::get('user_confirmed_last_mail', 0)->data; $now = time(); - $maxDiff = Config::get('firefly.confirmation_age'); + $maxDiff = config('firefly.confirmation_age'); if ($database === $code && ($now - $time <= $maxDiff)) { Preferences::setForUser(Auth::user(), 'user_confirmed', true); @@ -68,7 +67,7 @@ class ConfirmationController extends Controller { $time = Preferences::get('user_confirmed_last_mail', 0)->data; $now = time(); - $maxDiff = Config::get('firefly.resend_confirmation'); + $maxDiff = config('firefly.resend_confirmation'); $owner = env('SITE_OWNER', 'mail@example.com'); if ($now - $time > $maxDiff) { diff --git a/app/Http/Controllers/BillController.php b/app/Http/Controllers/BillController.php index 850c36671b..a64af3fba5 100644 --- a/app/Http/Controllers/BillController.php +++ b/app/Http/Controllers/BillController.php @@ -1,6 +1,5 @@ $bill->name]); // put previous url in session if not redirect from store (not "return_to_edit"). diff --git a/app/Http/Controllers/BudgetController.php b/app/Http/Controllers/BudgetController.php index 4357c9fe89..bcf7f3423c 100644 --- a/app/Http/Controllers/BudgetController.php +++ b/app/Http/Controllers/BudgetController.php @@ -163,8 +163,6 @@ class BudgetController extends Controller /** * Warn user if necessary */ - $range = Preferences::get('viewRange', '1M')->data; - $repeatFreq = Config::get('firefly.range_to_repeat_freq.' . $range); $userWarning = ''; if (session('is_custom_range', false) === true) { $userWarning = strval(trans('firefly.warn_range_' . $repeatFreq)); diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index 7f94bb0c4c..a7e9c9ae59 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -9,8 +9,8 @@ use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\Category; use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI; use FireflyIII\Repositories\Category\CategoryRepositoryInterface as CRI; -use FireflyIII\Repositories\Category\SingleCategoryRepositoryInterface as SCRI; use FireflyIII\Repositories\Category\SingleCategoryRepositoryInterface; +use FireflyIII\Repositories\Category\SingleCategoryRepositoryInterface as SCRI; use FireflyIII\Support\CacheProperties; use Illuminate\Support\Collection; use Navigation; diff --git a/app/Http/Controllers/CsvController.php b/app/Http/Controllers/CsvController.php index cec84760f3..39199726dd 100644 --- a/app/Http/Controllers/CsvController.php +++ b/app/Http/Controllers/CsvController.php @@ -3,7 +3,6 @@ declare(strict_types = 1); namespace FireflyIII\Http\Controllers; -use Config; use ExpandedForm; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Csv\Data; @@ -39,7 +38,7 @@ class CsvController extends Controller View::share('title', trans('firefly.csv')); View::share('mainTitleIcon', 'fa-file-text-o'); - if (Config::get('firefly.csv_import_enabled') === false) { + if (config('firefly.csv_import_enabled') === false) { throw new FireflyException('CSV Import is not enabled.'); } @@ -81,7 +80,7 @@ class CsvController extends Controller if ($this->data->hasHeaders()) { $headers = $firstRow; } - $keys = array_keys(Config::get('csv.roles')); + $keys = array_keys(config('csv.roles')); foreach ($keys as $name) { $availableRoles[$name] = trans('firefly.csv_column_' . $name); } @@ -179,7 +178,7 @@ class CsvController extends Controller // get list of supported specifix $specifix = []; - foreach (Config::get('csv.specifix') as $entry) { + foreach (config('csv.specifix') as $entry) { $specifix[$entry] = trans('firefly.csv_specifix_' . $entry); } diff --git a/app/Http/Controllers/ExportController.php b/app/Http/Controllers/ExportController.php index 9dcafa77a0..73853dcf49 100644 --- a/app/Http/Controllers/ExportController.php +++ b/app/Http/Controllers/ExportController.php @@ -11,7 +11,6 @@ declare(strict_types = 1); namespace FireflyIII\Http\Controllers; use Carbon\Carbon; -use Config; use ExpandedForm; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Export\Processor; @@ -106,8 +105,8 @@ class ExportController extends Controller $accounts = $repository->getAccounts(['Default account', 'Asset account']); $accountList = ExpandedForm::makeSelectList($accounts); $checked = array_keys($accountList); - $formats = array_keys(Config::get('firefly.export_formats')); - $defaultFormat = Preferences::get('export_format', Config::get('firefly.default_export_format'))->data; + $formats = array_keys(config('firefly.export_formats')); + $defaultFormat = Preferences::get('export_format', config('firefly.default_export_format'))->data; $first = session('first')->format('Y-m-d'); $today = Carbon::create()->format('Y-m-d'); diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 903d44a487..32e54220b3 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -3,13 +3,11 @@ use Amount; use Artisan; use Carbon\Carbon; -use Config; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Tag; use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI; use FireflyIII\Repositories\Tag\TagRepositoryInterface; use Input; -use Log; use Preferences; use Route; use Session; @@ -34,9 +32,9 @@ class HomeController extends Controller public function dateRange() { - $start = new Carbon(Input::get('start')); - $end = new Carbon(Input::get('end')); - $label = Input::get('label'); + $start = new Carbon(Input::get('start')); + $end = new Carbon(Input::get('end')); + $label = Input::get('label'); // check if the label is "everything" or "Custom range" which will betray // a possible problem with the budgets. @@ -101,7 +99,7 @@ class HomeController extends Controller */ public function index(ARI $repository) { - $types = Config::get('firefly.accountTypesByIdentifier.asset'); + $types = config('firefly.accountTypesByIdentifier.asset'); $count = $repository->countAccounts($types); if ($count == 0) { @@ -168,7 +166,7 @@ class HomeController extends Controller $methods = $route->getMethods(); if (!is_null($name) && in_array('GET', $methods) && !$this->startsWithAny($ignore, $name)) { - foreach (array_keys(Config::get('firefly.languages')) as $lang) { + foreach (array_keys(config('firefly.languages')) as $lang) { echo 'touch ' . $lang . '/' . $name . '.md
'; } diff --git a/app/Http/Controllers/JsonController.php b/app/Http/Controllers/JsonController.php index 1df37061df..f5a7a3104d 100644 --- a/app/Http/Controllers/JsonController.php +++ b/app/Http/Controllers/JsonController.php @@ -2,7 +2,6 @@ use Amount; use Carbon\Carbon; -use Config; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Report\ReportQueryInterface; use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI; @@ -36,7 +35,7 @@ class JsonController extends Controller public function action() { $count = intval(Input::get('count')) > 0 ? intval(Input::get('count')) : 1; - $keys = array_keys(Config::get('firefly.rule-actions')); + $keys = array_keys(config('firefly.rule-actions')); $actions = []; foreach ($keys as $key) { $actions[$key] = trans('firefly.rule_action_' . $key . '_choice'); @@ -297,7 +296,7 @@ class JsonController extends Controller public function trigger() { $count = intval(Input::get('count')) > 0 ? intval(Input::get('count')) : 1; - $keys = array_keys(Config::get('firefly.rule-triggers')); + $keys = array_keys(config('firefly.rule-triggers')); $triggers = []; foreach ($keys as $key) { if ($key != 'user_action') { diff --git a/app/Http/Controllers/NewUserController.php b/app/Http/Controllers/NewUserController.php index 05532e9071..b4015ca8d6 100644 --- a/app/Http/Controllers/NewUserController.php +++ b/app/Http/Controllers/NewUserController.php @@ -2,7 +2,6 @@ use Auth; use Carbon\Carbon; -use Config; use FireflyIII\Http\Requests\NewUserFormRequest; use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI; use Preferences; @@ -36,7 +35,7 @@ class NewUserController extends Controller View::share('mainTitleIcon', 'fa-fire'); - $types = Config::get('firefly.accountTypesByIdentifier.asset'); + $types = config('firefly.accountTypesByIdentifier.asset'); $count = $repository->countAccounts($types); if ($count > 0) { diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php index c7dfb69ec9..a95ccd496d 100644 --- a/app/Http/Controllers/PiggyBankController.php +++ b/app/Http/Controllers/PiggyBankController.php @@ -2,7 +2,6 @@ use Amount; use Carbon\Carbon; -use Config; use ExpandedForm; use FireflyIII\Http\Requests\PiggyBankFormRequest; use FireflyIII\Models\PiggyBank; @@ -65,7 +64,7 @@ class PiggyBankController extends Controller public function create(ARI $repository) { - $periods = Config::get('firefly.piggy_bank_periods'); + $periods = config('firefly.piggy_bank_periods'); $accounts = ExpandedForm::makeSelectList($repository->getAccounts(['Default account', 'Asset account'])); $subTitle = trans('firefly.new_piggy_bank'); $subTitleIcon = 'fa-plus'; @@ -124,7 +123,7 @@ class PiggyBankController extends Controller public function edit(ARI $repository, PiggyBank $piggyBank) { - $periods = Config::get('firefly.piggy_bank_periods'); + $periods = config('firefly.piggy_bank_periods'); $accounts = ExpandedForm::makeSelectList($repository->getAccounts(['Default account', 'Asset account'])); $subTitle = trans('firefly.update_piggy_title', ['name' => $piggyBank->name]); $subTitleIcon = 'fa-pencil'; diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index c6b4f59de6..9683dd9515 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -1,7 +1,6 @@ '', 'warning' => trans('firefly.warning_no_valid_triggers')]); } - $limit = Config::get('firefly.test-triggers.limit'); - $range = Config::get('firefly.test-triggers.range'); + $limit = config('firefly.test-triggers.limit'); + $range = config('firefly.test-triggers.range'); /** @var TransactionMatcher $matcher */ $matcher = app('FireflyIII\Rules\TransactionMatcher'); diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php index 1a34d604c5..6e615cca70 100644 --- a/app/Http/Controllers/TransactionController.php +++ b/app/Http/Controllers/TransactionController.php @@ -3,7 +3,6 @@ use Amount; use Auth; use Carbon\Carbon; -use Config; use ExpandedForm; use FireflyIII\Events\TransactionJournalStored; use FireflyIII\Events\TransactionJournalUpdated; @@ -212,8 +211,8 @@ class TransactionController extends Controller public function index(JournalRepositoryInterface $repository, string $what) { $pageSize = Preferences::get('transactionPageSize', 50)->data; - $subTitleIcon = Config::get('firefly.transactionIconsByWhat.' . $what); - $types = Config::get('firefly.transactionTypesByWhat.' . $what); + $subTitleIcon = config('firefly.transactionIconsByWhat.' . $what); + $types = config('firefly.transactionTypesByWhat.' . $what); $subTitle = trans('firefly.title_' . $what); $page = intval(Input::get('page')); $journals = $repository->getJournalsOfTypes($types, $page, $pageSize); diff --git a/app/Http/Requests/AccountFormRequest.php b/app/Http/Requests/AccountFormRequest.php index 5642e8f475..b76a2b60b4 100644 --- a/app/Http/Requests/AccountFormRequest.php +++ b/app/Http/Requests/AccountFormRequest.php @@ -4,7 +4,6 @@ declare(strict_types = 1); namespace FireflyIII\Http\Requests; use Auth; -use Config; use FireflyIII\Models\Account; use Input; @@ -30,9 +29,9 @@ class AccountFormRequest extends Request */ public function rules() { - $accountRoles = join(',', array_keys(Config::get('firefly.accountRoles'))); - $types = join(',', array_keys(Config::get('firefly.subTitlesByIdentifier'))); - $ccPaymentTypes = join(',', array_keys(Config::get('firefly.ccTypes'))); + $accountRoles = join(',', array_keys(config('firefly.accountRoles'))); + $types = join(',', array_keys(config('firefly.subTitlesByIdentifier'))); + $ccPaymentTypes = join(',', array_keys(config('firefly.ccTypes'))); $nameRule = 'required|min:1|uniqueAccountForUser'; $idRule = ''; diff --git a/app/Http/Requests/RuleFormRequest.php b/app/Http/Requests/RuleFormRequest.php index bfeb90c2e6..cc54cdf528 100644 --- a/app/Http/Requests/RuleFormRequest.php +++ b/app/Http/Requests/RuleFormRequest.php @@ -11,7 +11,6 @@ declare(strict_types = 1); namespace FireflyIII\Http\Requests; use Auth; -use Config; use FireflyIII\Models\RuleGroup; use Input; @@ -38,11 +37,11 @@ class RuleFormRequest extends Request public function rules() { - $validTriggers = array_keys(Config::get('firefly.rule-triggers')); - $validActions = array_keys(Config::get('firefly.rule-actions')); + $validTriggers = array_keys(config('firefly.rule-triggers')); + $validActions = array_keys(config('firefly.rule-actions')); // some actions require text: - $contextActions = join(',', Config::get('firefly.rule-actions-text')); + $contextActions = join(',', config('firefly.rule-actions-text')); $titleRule = 'required|between:1,100|uniqueObjectForUser:rule_groups,title'; if (RuleGroup::find(Input::get('id'))) { diff --git a/app/Http/Requests/TestRuleFormRequest.php b/app/Http/Requests/TestRuleFormRequest.php index dd79878a5f..2ff255b199 100644 --- a/app/Http/Requests/TestRuleFormRequest.php +++ b/app/Http/Requests/TestRuleFormRequest.php @@ -20,7 +20,6 @@ declare(strict_types = 1); namespace FireflyIII\Http\Requests; use Auth; -use Config; /** * Class RuleFormRequest @@ -45,7 +44,7 @@ class TestRuleFormRequest extends Request public function rules() { - $validTriggers = array_keys(Config::get('firefly.rule-triggers')); + $validTriggers = array_keys(config('firefly.rule-triggers')); $rules = [ 'rule-trigger.*' => 'required|min:1|in:' . join(',', $validTriggers), 'rule-trigger-value.*' => 'required|min:1|ruleTriggerValue', diff --git a/app/Http/breadcrumbs.php b/app/Http/breadcrumbs.php index 7c05a79ac9..a8364edd5e 100644 --- a/app/Http/breadcrumbs.php +++ b/app/Http/breadcrumbs.php @@ -55,7 +55,7 @@ Breadcrumbs::register( Breadcrumbs::register( 'accounts.show', function (BreadCrumbGenerator $breadcrumbs, Account $account) { - $what = Config::get('firefly.shortNamesByFullName.' . $account->accountType->type); + $what = config('firefly.shortNamesByFullName.' . $account->accountType->type); $breadcrumbs->parent('accounts.index', $what); @@ -73,7 +73,7 @@ Breadcrumbs::register( Breadcrumbs::register( 'accounts.edit', function (BreadCrumbGenerator $breadcrumbs, Account $account) { $breadcrumbs->parent('accounts.show', $account); - $what = Config::get('firefly.shortNamesByFullName.' . $account->accountType->type); + $what = config('firefly.shortNamesByFullName.' . $account->accountType->type); $breadcrumbs->push(trans('firefly.edit_' . $what . '_account', ['name' => e($account->name)]), route('accounts.edit', [$account->id])); } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 7295f28218..544d2465a9 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -3,7 +3,6 @@ declare(strict_types = 1); namespace FireflyIII\Providers; -use Config; use Illuminate\Support\ServiceProvider; use Log; @@ -34,7 +33,7 @@ class AppServiceProvider extends ServiceProvider // make sure the logger doesn't log everything when it doesn't need to. $monolog = Log::getMonolog(); foreach ($monolog->getHandlers() as $handler) { - $handler->setLevel(Config::get('app.log-level')); + $handler->setLevel(config('app.log-level')); } } } diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index 597fa5f14f..1c518a210f 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -3,7 +3,6 @@ namespace FireflyIII\Repositories\Account; use Carbon\Carbon; -use Config; use DB; use FireflyIII\Models\Account; use FireflyIII\Models\AccountMeta; @@ -614,7 +613,7 @@ class AccountRepository implements AccountRepositoryInterface */ protected function storeAccount(array $data): Account { - $type = Config::get('firefly.accountTypeByIdentifier.' . $data['accountType']); + $type = config('firefly.accountTypeByIdentifier.' . $data['accountType']); $accountType = AccountType::whereType($type)->first(); $newAccount = new Account( [ diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index befbdb7b29..d6a137cbbe 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -4,7 +4,6 @@ declare(strict_types = 1); namespace FireflyIII\Repositories\Budget; use Carbon\Carbon; -use Config; use DB; use FireflyIII\Models\Account; use FireflyIII\Models\Budget; @@ -870,7 +869,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn // there might be a budget limit for this startdate: $viewRange = Preferences::get('viewRange', '1M')->data; - $repeatFreq = Config::get('firefly.range_to_repeat_freq.' . $viewRange); + $repeatFreq = config('firefly.range_to_repeat_freq.' . $viewRange); /** @var BudgetLimit $limit */ $limit = $budget->budgetlimits()->where('budget_limits.startdate', $date)->where('budget_limits.repeat_freq', $repeatFreq)->first(['budget_limits.*']); diff --git a/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php b/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php index 86d881b232..eb8681a2eb 100644 --- a/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php +++ b/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php @@ -18,8 +18,8 @@ interface RuleGroupRepositoryInterface /** - * - * + * + * * @return int */ public function count(): int; diff --git a/app/Repositories/Tag/TagRepositoryInterface.php b/app/Repositories/Tag/TagRepositoryInterface.php index fe08065ba6..ade67fb0af 100644 --- a/app/Repositories/Tag/TagRepositoryInterface.php +++ b/app/Repositories/Tag/TagRepositoryInterface.php @@ -3,7 +3,6 @@ declare(strict_types = 1); namespace FireflyIII\Repositories\Tag; -use Carbon\Carbon; use FireflyIII\Models\Tag; use FireflyIII\Models\TransactionJournal; use Illuminate\Support\Collection; diff --git a/app/Repositories/User/UserRepositoryInterface.php b/app/Repositories/User/UserRepositoryInterface.php index 371c4306df..ffa30a8948 100644 --- a/app/Repositories/User/UserRepositoryInterface.php +++ b/app/Repositories/User/UserRepositoryInterface.php @@ -40,7 +40,7 @@ interface UserRepositoryInterface /** * Returns a count of all users. - * + * * @return int */ public function count(): int; diff --git a/app/Support/Domain.php b/app/Support/Domain.php index 1a1a6b061c..aa9d312e73 100644 --- a/app/Support/Domain.php +++ b/app/Support/Domain.php @@ -10,8 +10,6 @@ declare(strict_types = 1); namespace FireflyIII\Support; -use Config; - /** * Class Domain * @@ -24,7 +22,7 @@ class Domain */ public static function getBindables(): array { - return Config::get('firefly.bindables'); + return config('firefly.bindables'); } @@ -33,7 +31,7 @@ class Domain */ public static function getRuleActions(): array { - return Config::get('firefly.rule-actions'); + return config('firefly.rule-actions'); } /** @@ -41,6 +39,6 @@ class Domain */ public static function getRuleTriggers(): array { - return Config::get('firefly.rule-triggers'); + return config('firefly.rule-triggers'); } }