Skip to content

Firefly III: a personal finances manager

Fix some reported issues.

James Cole091f6e918b24
diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php
index dc57328bbd..5557539f35 100644
--- a/app/Http/Controllers/Admin/UserController.php
+++ b/app/Http/Controllers/Admin/UserController.php
@@ -92,16 +92,16 @@ class UserController extends Controller
$subTitleIcon = 'fa-user';
// get IP info:
- $defaultIp = '0.0.0.0';
- $registrationPreference = Preferences::getForUser($user, 'registration_ip_address');
- $registration = $defaultIp;
- $confirmationPreference = Preferences::getForUser($user, 'confirmation_ip_address');
- $confirmation = $defaultIp;
- if (!is_null($registrationPreference)) {
- $registration = $registrationPreference->data;
+ $defaultIp = '0.0.0.0';
+ $regPref = Preferences::getForUser($user, 'registration_ip_address');
+ $registration = $defaultIp;
+ $conPref = Preferences::getForUser($user, 'confirmation_ip_address');
+ $confirmation = $defaultIp;
+ if (!is_null($regPref)) {
+ $registration = $regPref->data;
}
- if (!is_null($confirmationPreference)) {
- $confirmation = $confirmationPreference->data;
+ if (!is_null($conPref)) {
+ $confirmation = $conPref->data;
}
$registrationHost = '';
diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php
index 9834dab7c0..ee09d7e9cd 100644
--- a/app/Http/Controllers/ReportController.php
+++ b/app/Http/Controllers/ReportController.php
@@ -153,8 +153,6 @@ class ReportController extends Controller
*/
private function auditReport(Carbon $start, Carbon $end, Collection $accounts)
{
- /** @var ARI $repos */
- $repos = app(ARI::class);
/** @var AccountTaskerInterface $tasker */
$tasker = app(AccountTaskerInterface::class);
$auditData = [];
diff --git a/app/Http/Controllers/Transaction/SplitController.php b/app/Http/Controllers/Transaction/SplitController.php
index e71fe2e60b..a50e31ccbf 100644
--- a/app/Http/Controllers/Transaction/SplitController.php
+++ b/app/Http/Controllers/Transaction/SplitController.php
@@ -43,18 +43,18 @@ class SplitController extends Controller
/** @var AccountRepositoryInterface */
private $accounts;
+
/** @var AttachmentHelperInterface */
private $attachments;
+
/** @var BudgetRepositoryInterface */
private $budgets;
+
/** @var CurrencyRepositoryInterface */
private $currencies;
/** @var JournalTaskerInterface */
private $tasker;
- //
- // /** @var PiggyBankRepositoryInterface */
- // private $piggyBanks;
/**
*
@@ -68,10 +68,9 @@ class SplitController extends Controller
// some useful repositories:
$this->middleware(
function ($request, $next) {
- $this->accounts = app(AccountRepositoryInterface::class);
- $this->budgets = app(BudgetRepositoryInterface::class);
- $this->tasker = app(JournalTaskerInterface::class);
- // $this->piggyBanks = app(PiggyBankRepositoryInterface::class);
+ $this->accounts = app(AccountRepositoryInterface::class);
+ $this->budgets = app(BudgetRepositoryInterface::class);
+ $this->tasker = app(JournalTaskerInterface::class);
$this->attachments = app(AttachmentHelperInterface::class);
$this->currencies = app(CurrencyRepositoryInterface::class);
@@ -157,7 +156,7 @@ class SplitController extends Controller
}
/**
- * @param Request $request
+ * @param Request $request
*
* @return array
*/
diff --git a/app/Http/breadcrumbs.php b/app/Http/breadcrumbs.php
index 17c71e60cd..44c4fc707e 100644
--- a/app/Http/breadcrumbs.php
+++ b/app/Http/breadcrumbs.php
@@ -119,7 +119,7 @@ Breadcrumbs::register(
Breadcrumbs::register(
'admin.users.show', function (BreadCrumbGenerator $breadcrumbs, User $user) {
$breadcrumbs->parent('admin.users');
- $breadcrumbs->push(trans('firefly.single_user_administration', ['email' => $user->email]), route('admin.users.show', $user->id));
+ $breadcrumbs->push(trans('firefly.single_user_administration', ['email' => $user->email]), route('admin.users.show', [$user->id]));
}
);
diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php
index f303fd1365..0412c3080c 100644
--- a/app/Repositories/Bill/BillRepository.php
+++ b/app/Repositories/Bill/BillRepository.php
@@ -372,7 +372,7 @@ class BillRepository implements BillRepositoryInterface
$nextExpectedMatch = $this->nextDateMatch($bill, $currentStart);
Log::debug(sprintf('Next Date match after %s is %s', $currentStart->format('Y-m-d'), $nextExpectedMatch->format('Y-m-d')));
/*
- * If $nextExpectedMatch is after $end, we continue:
+ * If nextExpectedMatch is after end, we continue:
*/
if ($nextExpectedMatch > $end) {
Log::debug(
@@ -482,7 +482,7 @@ class BillRepository implements BillRepositoryInterface
$cache->addProperty('nextDateMatch');
$cache->addProperty($date);
if ($cache->has()) {
- //return $cache->get();
+ return $cache->get();
}
// find the most recent date for this bill NOT in the future. Cache this date:
$start = clone $bill->date;
@@ -519,7 +519,7 @@ class BillRepository implements BillRepositoryInterface
$cache->addProperty('nextExpectedMatch');
$cache->addProperty($date);
if ($cache->has()) {
- //return $cache->get();
+ return $cache->get();
}
// find the most recent date for this bill NOT in the future. Cache this date:
$start = clone $bill->date;