Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
Scrutinizer Auto-Fixer
2015-05-26 18:57:31 +00:00
parent 946be80eef
commit 14a7cd05b1
39 changed files with 289 additions and 289 deletions

View File

@@ -31,7 +31,7 @@ class CategoryController extends Controller
}
/**
* @return $this
* @return \Illuminate\View\View
*/
public function create()
{
@@ -84,7 +84,7 @@ class CategoryController extends Controller
/**
* @param Category $category
*
* @return $this
* @return \Illuminate\View\View
*/
public function edit(Category $category)
{
@@ -105,14 +105,14 @@ class CategoryController extends Controller
/**
* @param CategoryRepositoryInterface $repository
*
* @return $this
* @return \Illuminate\View\View
*/
public function index(CategoryRepositoryInterface $repository)
{
$categories = $repository->getCategories();
$categories->each(
function (Category $category) use ($repository) {
function(Category $category) use ($repository) {
$category->lastActivity = $repository->getLatestActivity($category);
}
);
@@ -139,7 +139,7 @@ class CategoryController extends Controller
* @param CategoryRepositoryInterface $repository
* @param Category $category
*
* @return View
* @return \Illuminate\View\View
*/
public function show(CategoryRepositoryInterface $repository, Category $category)
{
@@ -157,7 +157,7 @@ class CategoryController extends Controller
* @param CategoryFormRequest $request
* @param CategoryRepositoryInterface $repository
*
* @return mixed
* @return \Illuminate\Http\RedirectResponse
*/
public function store(CategoryFormRequest $request, CategoryRepositoryInterface $repository)
{
@@ -165,7 +165,7 @@ class CategoryController extends Controller
'name' => $request->input('name'),
'user' => Auth::user()->id,
];
$category = $repository->store($categoryData);
$category = $repository->store($categoryData);
Session::flash('success', 'New category "' . $category->name . '" stored!');

View File

@@ -127,9 +127,9 @@ class BudgetController extends Controller
$overspent = $expenses > floatval($repetition->amount) ? $expenses - floatval($repetition->amount) : 0;
$allEntries->push(
[$budget->name . ' (' . $repetition->startdate->formatLocalized($this->monthAndDayFormat) . ')',
$left,
$spent,
$overspent
$left,
$spent,
$overspent
]
);
}

View File

@@ -80,7 +80,7 @@ class CategoryController extends Controller
// sort by callback:
uasort(
$set,
function ($left, $right) {
function($left, $right) {
if ($left['sum'] == $right['sum']) {
return 0;
}

View File

@@ -73,8 +73,8 @@ class HomeController extends Controller
if ($sum != 0) {
Session::flash(
'error', 'Your transactions are unbalanced. This means a'
. ' withdrawal, deposit or transfer was not stored properly. '
. 'Please check your accounts and transactions for errors.'
. ' withdrawal, deposit or transfer was not stored properly. '
. 'Please check your accounts and transactions for errors.'
);
}

View File

@@ -137,11 +137,11 @@ class PiggyBankController extends Controller
$targetDate = $targetDate->format('Y-m-d');
}
$preFilled = ['name' => $piggyBank->name,
'account_id' => $piggyBank->account_id,
'targetamount' => $piggyBank->targetamount,
'targetdate' => $targetDate,
'reminder' => $piggyBank->reminder,
'remind_me' => intval($piggyBank->remind_me) == 1 && !is_null($piggyBank->reminder) ? true : false
'account_id' => $piggyBank->account_id,
'targetamount' => $piggyBank->targetamount,
'targetdate' => $targetDate,
'reminder' => $piggyBank->reminder,
'remind_me' => intval($piggyBank->remind_me) == 1 && !is_null($piggyBank->reminder) ? true : false
];
Session::flash('preFilled', $preFilled);
Session::flash('gaEventCategory', 'piggy-banks');

View File

@@ -115,7 +115,7 @@ class TagController extends Controller
*
* @param TagRepositoryInterface $repository
*
* @return View
* @return \Illuminate\View\View
*/
public function edit(Tag $tag, TagRepositoryInterface $repository)
{
@@ -200,7 +200,7 @@ class TagController extends Controller
*
* @param TagRepositoryInterface $repository
*
* @return $this|\Illuminate\Http\RedirectResponse
* @return \Illuminate\Http\RedirectResponse
*/
public function store(TagFormRequest $request, TagRepositoryInterface $repository)
{
@@ -244,7 +244,7 @@ class TagController extends Controller
* @param TagRepositoryInterface $repository
* @param Tag $tag
*
* @return $this|\Illuminate\Http\RedirectResponse
* @return \Illuminate\Http\RedirectResponse
*/
public function update(TagFormRequest $request, TagRepositoryInterface $repository, Tag $tag)
{

View File

@@ -38,7 +38,7 @@ class TransactionController extends Controller
* @param AccountRepositoryInterface $repository
* @param string $what
*
* @return View
* @return \Illuminate\View\View
*/
public function create(AccountRepositoryInterface $repository, $what = 'deposit')
{
@@ -75,7 +75,7 @@ class TransactionController extends Controller
*
* @param TransactionJournal $journal
*
* @return $this
* @return \Illuminate\View\View
*/
public function delete(TransactionJournal $journal)
{
@@ -178,7 +178,7 @@ class TransactionController extends Controller
* @param JournalRepositoryInterface $repository
* @param $what
*
* @return View
* @return \Illuminate\View\View
*/
public function index(JournalRepositoryInterface $repository, $what)
{
@@ -244,12 +244,12 @@ class TransactionController extends Controller
* @param JournalRepositoryInterface $repository
* @param TransactionJournal $journal
*
* @return $this
* @return \Illuminate\View\View
*/
public function show(JournalRepositoryInterface $repository, TransactionJournal $journal)
{
$journal->transactions->each(
function (Transaction $t) use ($journal, $repository) {
function(Transaction $t) use ($journal, $repository) {
$t->before = $repository->getAmountBefore($journal, $t);
$t->after = $t->before + $t->amount;
}
@@ -263,7 +263,7 @@ class TransactionController extends Controller
* @param JournalFormRequest $request
* @param JournalRepositoryInterface $repository
*
* @return $this|\Illuminate\Http\RedirectResponse
* @return \Illuminate\Http\RedirectResponse
*/
public function store(JournalFormRequest $request, JournalRepositoryInterface $repository)
{
@@ -300,7 +300,7 @@ class TransactionController extends Controller
* @param JournalRepositoryInterface $repository
* @param TransactionJournal $journal
*
* @return $this|\Illuminate\Http\RedirectResponse
* @return \Illuminate\Http\RedirectResponse
*/
public function update(JournalFormRequest $request, JournalRepositoryInterface $repository, TransactionJournal $journal)
{

View File

@@ -68,7 +68,7 @@ class Reminders
// get and list active reminders:
$reminders = $this->auth->user()->reminders()->today()->get();
$reminders->each(
function (Reminder $reminder) use ($helper) {
function(Reminder $reminder) use ($helper) {
$reminder->description = $helper->getReminderText($reminder);
}
);

View File

@@ -15,13 +15,13 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
// models
Route::bind(
'account',
function ($value) {
function($value) {
if (Auth::check()) {
$object = Account::leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')
->where('account_types.editable', 1)
->where('accounts.id', $value)
->where('user_id', Auth::user()->id)
->first(['accounts.*']);
->where('account_types.editable', 1)
->where('accounts.id', $value)
->where('user_id', Auth::user()->id)
->first(['accounts.*']);
if ($object) {
return $object;
}
@@ -31,7 +31,7 @@ Route::bind(
);
Route::bind(
'tj', function ($value) {
'tj', function($value) {
if (Auth::check()) {
$object = TransactionJournal::where('id', $value)->where('user_id', Auth::user()->id)->first();
if ($object) {
@@ -44,7 +44,7 @@ Route::bind(
);
Route::bind(
'currency', function ($value) {
'currency', function($value) {
if (Auth::check()) {
$object = TransactionCurrency::find($value);
if ($object) {
@@ -56,7 +56,7 @@ Route::bind(
);
Route::bind(
'bill', function ($value) {
'bill', function($value) {
if (Auth::check()) {
$object = Bill::where('id', $value)->where('user_id', Auth::user()->id)->first();
if ($object) {
@@ -69,7 +69,7 @@ Route::bind(
);
Route::bind(
'budget', function ($value) {
'budget', function($value) {
if (Auth::check()) {
$object = Budget::where('id', $value)->where('user_id', Auth::user()->id)->first();
if ($object) {
@@ -82,7 +82,7 @@ Route::bind(
);
Route::bind(
'reminder', function ($value) {
'reminder', function($value) {
if (Auth::check()) {
$object = Reminder::where('id', $value)->where('user_id', Auth::user()->id)->first();
if ($object) {
@@ -95,13 +95,13 @@ Route::bind(
);
Route::bind(
'limitrepetition', function ($value) {
'limitrepetition', function($value) {
if (Auth::check()) {
$object = LimitRepetition::where('limit_repetitions.id', $value)
->leftjoin('budget_limits', 'budget_limits.id', '=', 'limit_repetitions.budget_limit_id')
->leftJoin('budgets', 'budgets.id', '=', 'budget_limits.budget_id')
->where('budgets.user_id', Auth::user()->id)
->first(['limit_repetitions.*']);
->leftjoin('budget_limits', 'budget_limits.id', '=', 'limit_repetitions.budget_limit_id')
->leftJoin('budgets', 'budgets.id', '=', 'budget_limits.budget_id')
->where('budgets.user_id', Auth::user()->id)
->first(['limit_repetitions.*']);
if ($object) {
return $object;
}
@@ -112,12 +112,12 @@ Route::bind(
);
Route::bind(
'piggyBank', function ($value) {
'piggyBank', function($value) {
if (Auth::check()) {
$object = PiggyBank::where('piggy_banks.id', $value)
->leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id')
->where('accounts.user_id', Auth::user()->id)
->first(['piggy_banks.*']);
->leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id')
->where('accounts.user_id', Auth::user()->id)
->first(['piggy_banks.*']);
if ($object) {
return $object;
}
@@ -128,7 +128,7 @@ Route::bind(
);
Route::bind(
'category', function ($value) {
'category', function($value) {
if (Auth::check()) {
$object = Category::where('id', $value)->where('user_id', Auth::user()->id)->first();
if ($object) {
@@ -142,7 +142,7 @@ Route::bind(
/** @noinspection PhpUnusedParameterInspection */
Route::bind(
'reminder', function ($value) {
'reminder', function($value) {
if (Auth::check()) {
/** @var \FireflyIII\Models\Reminder $object */
$object = Reminder::find($value);
@@ -158,7 +158,7 @@ Route::bind(
);
Route::bind(
'tag', function ($value) {
'tag', function($value) {
if (Auth::check()) {
$object = Tag::where('id', $value)->where('user_id', Auth::user()->id)->first();
if ($object) {
@@ -189,7 +189,7 @@ Route::get('/routes', ['uses' => 'HomeController@routes', 'as' => 'routes']);
* Home Controller
*/
Route::group(
['middleware' => ['auth', 'range', 'reminders']], function () {
['middleware' => ['auth', 'range', 'reminders']], function() {
Route::get('/', ['uses' => 'HomeController@index', 'as' => 'index', 'middleware' => 'cleanup']);
Route::get('/home', ['uses' => 'HomeController@index', 'as' => 'home']);
Route::post('/daterange', ['uses' => 'HomeController@dateRange', 'as' => 'daterange']);