Replaced Session::get() with session()

This commit is contained in:
James Cole
2016-02-04 07:27:03 +01:00
parent bd40615f8e
commit c1ecc62ac1
23 changed files with 126 additions and 136 deletions

View File

@@ -10,7 +10,6 @@ use FireflyIII\Support\CacheProperties;
use Illuminate\Support\Collection;
use Preferences;
use Response;
use Session;
/**
* Class AccountController
@@ -24,7 +23,7 @@ class AccountController extends Controller
protected $generator;
/**
* @codeCoverageIgnore
*
*/
public function __construct()
{
@@ -75,8 +74,8 @@ class AccountController extends Controller
*/
public function expenseAccounts(ARI $repository)
{
$start = clone Session::get('start', Carbon::now()->startOfMonth());
$end = clone Session::get('end', Carbon::now()->endOfMonth());
$start = clone session('start', Carbon::now()->startOfMonth());
$end = clone session('end', Carbon::now()->endOfMonth());
$accounts = $repository->getAccounts(['Expense account', 'Beneficiary account']);
// chart properties for cache:
@@ -106,8 +105,8 @@ class AccountController extends Controller
public function frontpage(ARI $repository)
{
$frontPage = Preferences::get('frontPageAccounts', []);
$start = clone Session::get('start', Carbon::now()->startOfMonth());
$end = clone Session::get('end', Carbon::now()->endOfMonth());
$start = clone session('start', Carbon::now()->startOfMonth());
$end = clone session('end', Carbon::now()->endOfMonth());
$accounts = $repository->getFrontpageAccounts($frontPage);
// chart properties for cache:
@@ -138,8 +137,8 @@ class AccountController extends Controller
{
$start = Session::get('start', Carbon::now()->startOfMonth());
$end = Session::get('end', Carbon::now()->endOfMonth());
$start = session('start', Carbon::now()->startOfMonth());
$end = session('end', Carbon::now()->endOfMonth());
// chart properties for cache:
$cache = new CacheProperties();

View File

@@ -9,7 +9,6 @@ use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use FireflyIII\Support\CacheProperties;
use Response;
use Session;
/**
* Class BillController
@@ -23,7 +22,7 @@ class BillController extends Controller
protected $generator;
/**
* @codeCoverageIgnore
*
*/
public function __construct()
{
@@ -41,8 +40,8 @@ class BillController extends Controller
*/
public function frontpage(BillRepositoryInterface $repository)
{
$start = Session::get('start', Carbon::now()->startOfMonth());
$end = Session::get('end', Carbon::now()->endOfMonth());
$start = session('start', Carbon::now()->startOfMonth());
$end = session('end', Carbon::now()->endOfMonth());
$paid = $repository->getBillsPaidInRange($start, $end); // will be a negative amount.
$unpaid = $repository->getBillsUnpaidInRange($start, $end); // will be a positive amount.
$creditCardDue = $repository->getCreditCardBill($start, $end);

View File

@@ -13,7 +13,6 @@ use Illuminate\Support\Collection;
use Navigation;
use Preferences;
use Response;
use Session;
/**
* Class BudgetController
@@ -27,7 +26,7 @@ class BudgetController extends Controller
protected $generator;
/**
* @codeCoverageIgnore
*
*/
public function __construct()
{
@@ -129,7 +128,7 @@ class BudgetController extends Controller
// dates and times
$first = $repository->getFirstBudgetLimitDate($budget);
$range = Preferences::get('viewRange', '1M')->data;
$last = Session::get('end', new Carbon);
$last = session('end', new Carbon);
// chart properties for cache:
$cache = new CacheProperties();
@@ -236,8 +235,8 @@ class BudgetController extends Controller
*/
public function frontpage(BudgetRepositoryInterface $repository, ARI $accountRepository)
{
$start = Session::get('start', Carbon::now()->startOfMonth());
$end = Session::get('end', Carbon::now()->endOfMonth());
$start = session('start', Carbon::now()->startOfMonth());
$end = session('end', Carbon::now()->endOfMonth());
// chart properties for cache:
$cache = new CacheProperties();

View File

@@ -13,7 +13,6 @@ use Illuminate\Support\Collection;
use Navigation;
use Preferences;
use Response;
use Session;
use stdClass;
/**
@@ -27,7 +26,7 @@ class CategoryController extends Controller
protected $generator;
/**
* @codeCoverageIgnore
*
*/
public function __construct()
{
@@ -92,8 +91,8 @@ class CategoryController extends Controller
*/
public function currentPeriod(SCRI $repository, Category $category)
{
$start = clone Session::get('start', Carbon::now()->startOfMonth());
$end = Session::get('end', Carbon::now()->endOfMonth());
$start = clone session('start', Carbon::now()->startOfMonth());
$end = session('end', Carbon::now()->endOfMonth());
$data = $this->makePeriodChart($repository, $category, $start, $end);
return Response::json($data);
@@ -176,8 +175,8 @@ class CategoryController extends Controller
public function frontpage(CRI $repository)
{
$start = Session::get('start', Carbon::now()->startOfMonth());
$end = Session::get('end', Carbon::now()->endOfMonth());
$start = session('start', Carbon::now()->startOfMonth());
$end = session('end', Carbon::now()->endOfMonth());
// chart properties for cache:
$cache = new CacheProperties;
@@ -395,7 +394,7 @@ class CategoryController extends Controller
$cache->addProperty($category->id);
$cache->addProperty('specific-period');
if ($cache->has()) {
return $cache->get(); // @codeCoverageIgnore
return $cache->get(); //
}
$entries = new Collection;