Some code cleanup. Fixes the tests.

This commit is contained in:
James Cole
2016-04-25 18:43:09 +02:00
parent 53c80aaef8
commit eb5e55a272
32 changed files with 64 additions and 54 deletions

View File

@@ -174,9 +174,9 @@ class BillController extends Controller
*/
public function show(BillRepositoryInterface $repository, Bill $bill)
{
$page = intval(Input::get('page')) == 0 ? 1 : intval(Input::get('page'));
$pageSize = Preferences::get('transactionPageSize', 50)->data;
$journals = $repository->getJournals($bill, $page, $pageSize);
$page = intval(Input::get('page')) == 0 ? 1 : intval(Input::get('page'));
$pageSize = Preferences::get('transactionPageSize', 50)->data;
$journals = $repository->getJournals($bill, $page, $pageSize);
$journals->setPath('/bills/show/' . $bill->id);
$bill->nextExpectedMatch = $repository->nextExpectedMatch($bill);
$hideBill = true;

View File

@@ -149,7 +149,6 @@ class BudgetController extends Controller
$budgeted = '0';
$range = Preferences::get('viewRange', '1M')->data;
$repeatFreq = Config::get('firefly.range_to_repeat_freq.' . $range);
/** @var Carbon $date */
/** @var Carbon $start */
$start = session('start', new Carbon);
/** @var Carbon $end */

View File

@@ -7,7 +7,6 @@ use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\PiggyBank;
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
use FireflyIII\Support\CacheProperties;
use Illuminate\Support\Collection;
use Response;

View File

@@ -100,9 +100,9 @@ class ReportController extends Controller
break;
case ($role === BalanceLine::ROLE_DIFFROLE):
// journals no budget, not corrected by a tag.
$journals = $budgetRepository->getAllWithoutBudget($account, $attributes['accounts'], $attributes['startDate'], $attributes['endDate']);
$journals = $budgetRepository->getAllWithoutBudget($account, $attributes['accounts'], $attributes['startDate'], $attributes['endDate']);
$budget->name = strval(trans('firefly.leftUnbalanced'));
$journals = $journals->filter(
$journals = $journals->filter(
function (TransactionJournal $journal) {
$tags = $journal->tags()->where('tagMode', 'balancingAct')->count();
if ($tags === 0) {

View File

@@ -138,7 +138,7 @@ class PreferencesController extends Controller
// save page size:
$transactionPageSize = intval(Input::get('transactionPageSize'));
if($transactionPageSize > 0 && $transactionPageSize < 1337) {
if ($transactionPageSize > 0 && $transactionPageSize < 1337) {
Preferences::set('transactionPageSize', $transactionPageSize);
} else {
Preferences::set('transactionPageSize', 50);

View File

@@ -36,15 +36,16 @@ class Kernel extends HttpKernel
*
* @var array
*/
protected $bootstrappers = [
'Illuminate\Foundation\Bootstrap\DetectEnvironment',
'Illuminate\Foundation\Bootstrap\LoadConfiguration',
'FireflyIII\Bootstrap\ConfigureLogging',
'Illuminate\Foundation\Bootstrap\HandleExceptions',
'Illuminate\Foundation\Bootstrap\RegisterFacades',
'Illuminate\Foundation\Bootstrap\RegisterProviders',
'Illuminate\Foundation\Bootstrap\BootProviders',
];
protected $bootstrappers
= [
'Illuminate\Foundation\Bootstrap\DetectEnvironment',
'Illuminate\Foundation\Bootstrap\LoadConfiguration',
'FireflyIII\Bootstrap\ConfigureLogging',
'Illuminate\Foundation\Bootstrap\HandleExceptions',
'Illuminate\Foundation\Bootstrap\RegisterFacades',
'Illuminate\Foundation\Bootstrap\RegisterProviders',
'Illuminate\Foundation\Bootstrap\BootProviders',
];
/**
* The application's global HTTP middleware stack.
@@ -144,7 +145,7 @@ class Kernel extends HttpKernel
// MUST be confirmed.
// MUST have owner role
// (this group includes the other Firefly middleware)
'admin' => [
'admin' => [
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,