Various code cleanup

This commit is contained in:
James Cole
2017-09-16 07:17:58 +02:00
parent bbab89d884
commit b1135cee60
18 changed files with 37 additions and 40 deletions

View File

@@ -34,10 +34,11 @@ class ForgotPasswordController extends Controller
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->middleware('guest');
}
}

View File

@@ -46,7 +46,6 @@ class LoginController extends Controller
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{

View File

@@ -41,10 +41,10 @@ class ResetPasswordController extends Controller
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->middleware('guest');
}
}

View File

@@ -239,6 +239,7 @@ class CategoryController extends Controller
if ($moment === 'all') {
$subTitle = trans('firefly.all_journals_for_category', ['name' => $category->name]);
$first = $repository->firstUseDate($category);
/** @var Carbon $start */
$start = is_null($first) ? new Carbon : $first;
$end = new Carbon;
}
@@ -257,7 +258,9 @@ class CategoryController extends Controller
// prep for current period
if (strlen($moment) === 0) {
/** @var Carbon $start */
$start = clone session('start', Navigation::startOfPeriod(new Carbon, $range));
/** @var Carbon $end */
$end = clone session('end', Navigation::endOfPeriod(new Carbon, $range));
$periods = $this->getPeriodOverview($category);
$subTitle = trans(

View File

@@ -79,7 +79,6 @@ class BankController extends Controller
return redirect(route('import.bank.form', [$bank]));
}
$remoteAccounts = array_keys($remoteAccounts);
$class = config(sprintf('firefly.import_pre.%s', $bank));
// get import file

View File

@@ -225,7 +225,9 @@ class TagController extends Controller
// prep for current period
if (strlen($moment) === 0) {
/** @var Carbon $start */
$start = clone session('start', Navigation::startOfPeriod(new Carbon, $range));
/** @var Carbon $end */
$end = clone session('end', Navigation::endOfPeriod(new Carbon, $range));
$periods = $this->getPeriodOverview($tag);
$sum = $repository->sumOfTag($tag, $start, $end);