mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 02:26:58 +00:00
Small optimizations.
This commit is contained in:
@@ -145,6 +145,8 @@ class BudgetController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @SuppressWarnings("CyclomaticComplexity") // It's exactly 5. So I don't mind.
|
||||||
|
*
|
||||||
* @param Budget $budget
|
* @param Budget $budget
|
||||||
* @param LimitRepetition $repetition
|
* @param LimitRepetition $repetition
|
||||||
*
|
*
|
||||||
@@ -181,10 +183,11 @@ class BudgetController extends BaseController
|
|||||||
Session::flash('errors', $messages['errors']);
|
Session::flash('errors', $messages['errors']);
|
||||||
if ($messages['errors']->count() > 0) {
|
if ($messages['errors']->count() > 0) {
|
||||||
Session::flash('error', 'Could not validate budget: ' . $messages['errors']->first());
|
Session::flash('error', 'Could not validate budget: ' . $messages['errors']->first());
|
||||||
|
return Redirect::route('budgets.create')->withInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
// return to create screen:
|
// return to create screen:
|
||||||
if ($data['post_submit_action'] == 'validate_only' || $messages['errors']->count() > 0) {
|
if ($data['post_submit_action'] == 'validate_only') {
|
||||||
return Redirect::route('budgets.create')->withInput();
|
return Redirect::route('budgets.create')->withInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,10 +222,11 @@ class BudgetController extends BaseController
|
|||||||
Session::flash('errors', $messages['errors']);
|
Session::flash('errors', $messages['errors']);
|
||||||
if ($messages['errors']->count() > 0) {
|
if ($messages['errors']->count() > 0) {
|
||||||
Session::flash('error', 'Could not update budget: ' . $messages['errors']->first());
|
Session::flash('error', 'Could not update budget: ' . $messages['errors']->first());
|
||||||
|
return Redirect::route('budgets.edit', $budget->id)->withInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
// return to update screen:
|
// return to update screen:
|
||||||
if ($data['post_submit_action'] == 'validate_only' || $messages['errors']->count() > 0) {
|
if ($data['post_submit_action'] == 'validate_only') {
|
||||||
return Redirect::route('budgets.edit', $budget->id)->withInput();
|
return Redirect::route('budgets.edit', $budget->id)->withInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -105,6 +105,7 @@ class CategoryController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
* @throws FireflyException
|
* @throws FireflyException
|
||||||
*/
|
*/
|
||||||
@@ -122,10 +123,11 @@ class CategoryController extends BaseController
|
|||||||
Session::flash('errors', $messages['errors']);
|
Session::flash('errors', $messages['errors']);
|
||||||
if ($messages['errors']->count() > 0) {
|
if ($messages['errors']->count() > 0) {
|
||||||
Session::flash('error', 'Could not store category: ' . $messages['errors']->first());
|
Session::flash('error', 'Could not store category: ' . $messages['errors']->first());
|
||||||
|
return Redirect::route('categories.create')->withInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
// return to create screen:
|
// return to create screen:
|
||||||
if ($data['post_submit_action'] == 'validate_only' || $messages['errors']->count() > 0) {
|
if ($data['post_submit_action'] == 'validate_only') {
|
||||||
return Redirect::route('categories.create')->withInput();
|
return Redirect::route('categories.create')->withInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,6 +142,7 @@ class CategoryController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @param Category $category
|
* @param Category $category
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
@@ -159,10 +162,11 @@ class CategoryController extends BaseController
|
|||||||
Session::flash('errors', $messages['errors']);
|
Session::flash('errors', $messages['errors']);
|
||||||
if ($messages['errors']->count() > 0) {
|
if ($messages['errors']->count() > 0) {
|
||||||
Session::flash('error', 'Could not update category: ' . $messages['errors']->first());
|
Session::flash('error', 'Could not update category: ' . $messages['errors']->first());
|
||||||
|
return Redirect::route('categories.edit', $category->id)->withInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
// return to update screen:
|
// return to update screen:
|
||||||
if ($data['post_submit_action'] == 'validate_only' || $messages['errors']->count() > 0) {
|
if ($data['post_submit_action'] == 'validate_only') {
|
||||||
return Redirect::route('categories.edit', $category->id)->withInput();
|
return Redirect::route('categories.edit', $category->id)->withInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -122,6 +122,8 @@ class CurrencyController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @SuppressWarnings("CyclomaticComplexity") // It's exactly 5. So I don't mind.
|
||||||
|
*
|
||||||
* @return $this|\Illuminate\Http\RedirectResponse
|
* @return $this|\Illuminate\Http\RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function store()
|
public function store()
|
||||||
@@ -173,10 +175,11 @@ class CurrencyController extends BaseController
|
|||||||
Session::flash('errors', $messages['errors']);
|
Session::flash('errors', $messages['errors']);
|
||||||
if ($messages['errors']->count() > 0) {
|
if ($messages['errors']->count() > 0) {
|
||||||
Session::flash('error', 'Could not update currency: ' . $messages['errors']->first());
|
Session::flash('error', 'Could not update currency: ' . $messages['errors']->first());
|
||||||
|
return Redirect::route('currency.edit', $currency->id)->withInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
// return to update screen:
|
// return to update screen:
|
||||||
if ($data['post_submit_action'] == 'validate_only' || $messages['errors']->count() > 0) {
|
if ($data['post_submit_action'] == 'validate_only') {
|
||||||
return Redirect::route('currency.edit', $currency->id)->withInput();
|
return Redirect::route('currency.edit', $currency->id)->withInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -72,7 +72,7 @@ class GoogleChartController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method renders the b
|
* @SuppressWarnings("CyclomaticComplexity") // It's exactly 5. So I don't mind.
|
||||||
*/
|
*/
|
||||||
public function allAccountsBalanceChart()
|
public function allAccountsBalanceChart()
|
||||||
{
|
{
|
||||||
|
@@ -1,8 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @SuppressWarnings("CamelCase") // I'm fine with this.
|
||||||
*
|
*
|
||||||
* Class HelpController
|
* Class HelpController
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
class HelpController extends BaseController
|
class HelpController extends BaseController
|
||||||
{
|
{
|
||||||
|
@@ -93,6 +93,8 @@ class PiggyBankController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @SuppressWarnings("CyclomaticComplexity") // It's exactly 5. So I don't mind.
|
||||||
|
*
|
||||||
* @param PiggyBank $piggyBank
|
* @param PiggyBank $piggyBank
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @SuppressWarnings("CamelCase") // I'm fine with this.
|
||||||
* Class ProfileController
|
* Class ProfileController
|
||||||
*/
|
*/
|
||||||
class ProfileController extends BaseController
|
class ProfileController extends BaseController
|
||||||
@@ -56,6 +56,8 @@ class ProfileController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @SuppressWarnings("CyclomaticComplexity") // It's exactly 5. So I don't mind.
|
||||||
|
*
|
||||||
* @param string $old
|
* @param string $old
|
||||||
* @param string $new1
|
* @param string $new1
|
||||||
* @param string $new2
|
* @param string $new2
|
||||||
|
@@ -22,6 +22,8 @@ class RelatedController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @SuppressWarnings("CyclomaticComplexity") // It's exactly 5. So I don't mind.
|
||||||
|
*
|
||||||
* @param TransactionJournal $journal
|
* @param TransactionJournal $journal
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Http\JsonResponse
|
* @return \Illuminate\Http\JsonResponse
|
||||||
@@ -96,6 +98,8 @@ class RelatedController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @SuppressWarnings("CyclomaticComplexity") // It's exactly 5. So I don't mind.
|
||||||
|
*
|
||||||
* @param TransactionJournal $parentJournal
|
* @param TransactionJournal $parentJournal
|
||||||
* @param TransactionJournal $childJournal
|
* @param TransactionJournal $childJournal
|
||||||
*
|
*
|
||||||
|
@@ -158,11 +158,12 @@ class RepeatedExpenseController extends BaseController
|
|||||||
Session::flash('errors', $messages['errors']);
|
Session::flash('errors', $messages['errors']);
|
||||||
if ($messages['errors']->count() > 0) {
|
if ($messages['errors']->count() > 0) {
|
||||||
Session::flash('error', 'Could not store repeated expense: ' . $messages['errors']->first());
|
Session::flash('error', 'Could not store repeated expense: ' . $messages['errors']->first());
|
||||||
|
return Redirect::route('repeated.create')->withInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// return to create screen:
|
// return to create screen:
|
||||||
if ($data['post_submit_action'] == 'validate_only' || $messages['errors']->count() > 0) {
|
if ($data['post_submit_action'] == 'validate_only') {
|
||||||
return Redirect::route('repeated.create')->withInput();
|
return Redirect::route('repeated.create')->withInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user