Code cleanup.

This commit is contained in:
James Cole
2015-12-28 07:12:47 +01:00
parent f263844793
commit 51b45b4ed4
22 changed files with 209 additions and 211 deletions

View File

@@ -236,7 +236,7 @@ class BudgetController extends Controller
// we already have amount, startdate and enddate.
// if this "is" a limit repetition (as opposed to a budget without one entirely)
// depends on whether startdate and enddate are null.
$name = $budget->name;
$name = $budget->name;
if (is_null($budget->startdate) && is_null($budget->enddate)) {
$currentStart = clone $start;
$currentEnd = clone $end;
@@ -252,7 +252,7 @@ class BudgetController extends Controller
$amount = $budget->amount;
// smaller than 1 means spent MORE than budget allows.
$left = bccomp(bcadd($budget->amount, $expenses), '0') < 1 ? 0 : bcadd($budget->amount, $expenses);
$spent = bccomp(bcadd($budget->amount, $expenses), '0') < 1 ? ($amount*-1) : $expenses;
$spent = bccomp(bcadd($budget->amount, $expenses), '0') < 1 ? ($amount * -1) : $expenses;
$overspent = bccomp(bcadd($budget->amount, $expenses), '0') < 1 ? bcadd($budget->amount, $expenses) : 0;
}

View File

@@ -1,7 +1,6 @@
<?php namespace FireflyIII\Http\Controllers;
use Auth;
use Config;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

View File

@@ -1,15 +1,12 @@
<?php namespace FireflyIII\Http\Controllers;
use Artisan;
use Auth;
use Carbon\Carbon;
use Config;
use FireflyIII\Models\Tag;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use Input;
use Log;
use Preferences;
use Route;
use Session;
use Steam;

View File

@@ -64,9 +64,12 @@ class ReportController extends Controller
$accountList = join(',', $accountIds);
return view('reports.index', compact('months', 'accounts', 'start', 'accountList',
'startOfMonth', 'endOfMonth', 'startOfYear', 'endOfYear'
));
return view(
'reports.index', compact(
'months', 'accounts', 'start', 'accountList',
'startOfMonth', 'endOfMonth', 'startOfYear', 'endOfYear'
)
);
}
/**

View File

@@ -4,7 +4,6 @@ use App;
use Auth;
use Carbon\Carbon;
use Closure;
use Config;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Http\Request;
use Preferences;
@@ -61,9 +60,9 @@ class Authenticate
}
// if logged in, set user language:
$pref = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'));
$pref = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'));
App::setLocale($pref->data);
Carbon::setLocale(substr($pref->data,0,2));
Carbon::setLocale(substr($pref->data, 0, 2));
$locale = explode(',', trans('config.locale'));
$locale = array_map('trim', $locale);