Skip to content

Commit

Permalink
null-safe
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici authored May 31, 2022
1 parent b576005 commit a89b289
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
}
],
"require": {
"php": ">=7.3",
"php": ">=8.0",
"barryvdh/laravel-debugbar": "^3.6"
},
"require-dev": {
"orchestra/testbench": "^6.0",
"orchestra/testbench": "^7.0",
"phpunit/phpunit": "^9.0"
},
"autoload": {
Expand Down
8 changes: 4 additions & 4 deletions src/AkauntingCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ public function collect()
$company_date_format = company_date_format() . ' (' . company_date(Date::createFromTimestamp(0)) . ')';

if ($account_id = setting('default.account', null)) {
$default_account = Account::find($account_id)->getAttributes();
$default_account = Account::find($account_id)?->getAttributes();
}

if ($currency_code = setting('default.currency')) {
$default_currency = Currency::code($currency_code)->first()->getAttributes();
$default_currency = Currency::code($currency_code)->first()?->getAttributes();
}

if ($income_category_id = setting('default.income_category', null)) {
$default_income_category = Category::find($income_category_id)->getAttributes();
$default_income_category = Category::find($income_category_id)?->getAttributes();
}

if ($expense_category_id = setting('default.expense_category', null)) {
$default_expense_category = Category::find($expense_category_id)->getAttributes();
$default_expense_category = Category::find($expense_category_id)?->getAttributes();
}

$default_locale = setting('default.locale');
Expand Down

0 comments on commit a89b289

Please sign in to comment.