Some cleaning up.

This commit is contained in:
James Cole
2015-12-29 22:48:55 +01:00
parent 95f4a83f41
commit 7cc47ca0b1
11 changed files with 114 additions and 114 deletions

View File

@@ -29,6 +29,22 @@ class RabobankDescription
} }
/**
* @param array $data
*/
public function setData($data)
{
$this->data = $data;
}
/**
* @param array $row
*/
public function setRow($row)
{
$this->row = $row;
}
/** /**
* Fixes Rabobank specific thing. * Fixes Rabobank specific thing.
*/ */
@@ -46,21 +62,5 @@ class RabobankDescription
} }
/**
* @param array $data
*/
public function setData($data)
{
$this->data = $data;
}
/**
* @param array $row
*/
public function setRow($row)
{
$this->row = $row;
}
} }

View File

@@ -78,6 +78,7 @@ class PasswordController extends Controller
} }
abort(404); abort(404);
return ''; return '';
} }

View File

@@ -4,8 +4,8 @@ use Auth;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Http\Requests\CategoryFormRequest; use FireflyIII\Http\Requests\CategoryFormRequest;
use FireflyIII\Models\Category; use FireflyIII\Models\Category;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface as CRI;
use FireflyIII\Repositories\Category\SingleCategoryRepositoryInterface; use FireflyIII\Repositories\Category\SingleCategoryRepositoryInterface as SCRI;
use FireflyIII\Support\CacheProperties; use FireflyIII\Support\CacheProperties;
use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
@@ -69,12 +69,12 @@ class CategoryController extends Controller
} }
/** /**
* @param SingleCategoryRepositoryInterface $repository * @param SCRI $repository
* @param Category $category * @param Category $category
* *
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
*/ */
public function destroy(SingleCategoryRepositoryInterface $repository, Category $category) public function destroy(SCRI $repository, Category $category)
{ {
$name = $category->name; $name = $category->name;
@@ -108,12 +108,12 @@ class CategoryController extends Controller
} }
/** /**
* @param CategoryRepositoryInterface $repository * @param CRI $repository
* @param SingleCategoryRepositoryInterface $singleRepository * @param SCRI $singleRepository
* *
* @return \Illuminate\View\View * @return \Illuminate\View\View
*/ */
public function index(CategoryRepositoryInterface $repository, SingleCategoryRepositoryInterface $singleRepository) public function index(CRI $repository, SCRI $singleRepository)
{ {
$categories = $repository->getCategories(); $categories = $repository->getCategories();
@@ -127,11 +127,11 @@ class CategoryController extends Controller
} }
/** /**
* @param CategoryRepositoryInterface $repository * @param CRI $repository
* *
* @return \Illuminate\View\View * @return \Illuminate\View\View
*/ */
public function noCategory(CategoryRepositoryInterface $repository) public function noCategory(CRI $repository)
{ {
$start = Session::get('start', Carbon::now()->startOfMonth()); $start = Session::get('start', Carbon::now()->startOfMonth());
$end = Session::get('end', Carbon::now()->startOfMonth()); $end = Session::get('end', Carbon::now()->startOfMonth());
@@ -145,14 +145,14 @@ class CategoryController extends Controller
} }
/** /**
* @param SingleCategoryRepositoryInterface $repository * @param SCRI $repository
* @param Category $category * @param Category $category
* *
* @param $date * @param $date
* *
* @return \Illuminate\View\View * @return \Illuminate\View\View
*/ */
public function showWithDate(SingleCategoryRepositoryInterface $repository, Category $category, $date) public function showWithDate(SCRI $repository, Category $category, $date)
{ {
$carbon = new Carbon($date); $carbon = new Carbon($date);
$range = Preferences::get('viewRange', '1M')->data; $range = Preferences::get('viewRange', '1M')->data;
@@ -172,12 +172,12 @@ class CategoryController extends Controller
} }
/** /**
* @param SingleCategoryRepositoryInterface $repository * @param SCRI $repository
* @param Category $category * @param Category $category
* *
* @return \Illuminate\View\View * @return \Illuminate\View\View
*/ */
public function show(SingleCategoryRepositoryInterface $repository, Category $category) public function show(SCRI $repository, Category $category)
{ {
$hideCategory = true; // used in list. $hideCategory = true; // used in list.
$page = intval(Input::get('page')); $page = intval(Input::get('page'));
@@ -228,11 +228,11 @@ class CategoryController extends Controller
/** /**
* @param CategoryFormRequest $request * @param CategoryFormRequest $request
* @param SingleCategoryRepositoryInterface $repository * @param SCRI $repository
* *
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
*/ */
public function store(CategoryFormRequest $request, SingleCategoryRepositoryInterface $repository) public function store(CategoryFormRequest $request, SCRI $repository)
{ {
$categoryData = [ $categoryData = [
'name' => $request->input('name'), 'name' => $request->input('name'),
@@ -255,12 +255,12 @@ class CategoryController extends Controller
/** /**
* @param CategoryFormRequest $request * @param CategoryFormRequest $request
* @param SingleCategoryRepositoryInterface $repository * @param SCRI $repository
* @param Category $category * @param Category $category
* *
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
*/ */
public function update(CategoryFormRequest $request, SingleCategoryRepositoryInterface $repository, Category $category) public function update(CategoryFormRequest $request, SCRI $repository, Category $category)
{ {
$categoryData = [ $categoryData = [
'name' => $request->input('name'), 'name' => $request->input('name'),

View File

@@ -6,8 +6,8 @@ namespace FireflyIII\Http\Controllers\Chart;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Category; use FireflyIII\Models\Category;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface as CRI;
use FireflyIII\Repositories\Category\SingleCategoryRepositoryInterface; use FireflyIII\Repositories\Category\SingleCategoryRepositoryInterface as SCRI;
use FireflyIII\Support\CacheProperties; use FireflyIII\Support\CacheProperties;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Navigation; use Navigation;
@@ -39,12 +39,12 @@ class CategoryController extends Controller
/** /**
* Show an overview for a category for all time, per month/week/year. * Show an overview for a category for all time, per month/week/year.
* *
* @param SingleCategoryRepositoryInterface $repository * @param SCRI $repository
* @param Category $category * @param Category $category
* *
* @return \Symfony\Component\HttpFoundation\Response * @return \Symfony\Component\HttpFoundation\Response
*/ */
public function all(SingleCategoryRepositoryInterface $repository, Category $category) public function all(SCRI $repository, Category $category)
{ {
// oldest transaction in category: // oldest transaction in category:
$start = $repository->getFirstActivityDate($category); $start = $repository->getFirstActivityDate($category);
@@ -88,11 +88,11 @@ class CategoryController extends Controller
/** /**
* Show this month's category overview. * Show this month's category overview.
* *
* @param CategoryRepositoryInterface $repository * @param CRI $repository
* *
* @return \Symfony\Component\HttpFoundation\Response * @return \Symfony\Component\HttpFoundation\Response
*/ */
public function frontpage(CategoryRepositoryInterface $repository) public function frontpage(CRI $repository)
{ {
$start = Session::get('start', Carbon::now()->startOfMonth()); $start = Session::get('start', Carbon::now()->startOfMonth());
@@ -212,12 +212,12 @@ class CategoryController extends Controller
} }
/** /**
* @param SingleCategoryRepositoryInterface $repository * @param SCRI $repository
* @param Category $category * @param Category $category
* *
* @return \Symfony\Component\HttpFoundation\Response * @return \Symfony\Component\HttpFoundation\Response
*/ */
public function currentPeriod(SingleCategoryRepositoryInterface $repository, Category $category) public function currentPeriod(SCRI $repository, Category $category)
{ {
$start = clone Session::get('start', Carbon::now()->startOfMonth()); $start = clone Session::get('start', Carbon::now()->startOfMonth());
$end = Session::get('end', Carbon::now()->endOfMonth()); $end = Session::get('end', Carbon::now()->endOfMonth());
@@ -252,14 +252,14 @@ class CategoryController extends Controller
} }
/** /**
* @param SingleCategoryRepositoryInterface $repository * @param SCRI $repository
* @param Category $category * @param Category $category
* *
* @param $date * @param $date
* *
* @return \Symfony\Component\HttpFoundation\Response * @return \Symfony\Component\HttpFoundation\Response
*/ */
public function specificPeriod(SingleCategoryRepositoryInterface $repository, Category $category, $date) public function specificPeriod(SCRI $repository, Category $category, $date)
{ {
$carbon = new Carbon($date); $carbon = new Carbon($date);
$range = Preferences::get('viewRange', '1M')->data; $range = Preferences::get('viewRange', '1M')->data;
@@ -300,7 +300,7 @@ class CategoryController extends Controller
* Returns a chart of what has been earned in this period in each category * Returns a chart of what has been earned in this period in each category
* grouped by month. * grouped by month.
* *
* @param CategoryRepositoryInterface $repository * @param CRI $repository
* @param $reportType * @param $reportType
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
@@ -308,7 +308,7 @@ class CategoryController extends Controller
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*/ */
public function earnedInPeriod(CategoryRepositoryInterface $repository, $reportType, Carbon $start, Carbon $end, Collection $accounts) public function earnedInPeriod(CRI $repository, $reportType, Carbon $start, Carbon $end, Collection $accounts)
{ {
$cache = new CacheProperties; // chart properties for cache: $cache = new CacheProperties; // chart properties for cache:
$cache->addProperty($start); $cache->addProperty($start);
@@ -367,7 +367,7 @@ class CategoryController extends Controller
* Returns a chart of what has been spent in this period in each category * Returns a chart of what has been spent in this period in each category
* grouped by month. * grouped by month.
* *
* @param CategoryRepositoryInterface $repository * @param CRI $repository
* @param $reportType * @param $reportType
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
@@ -375,7 +375,7 @@ class CategoryController extends Controller
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*/ */
public function spentInPeriod(CategoryRepositoryInterface $repository, $reportType, Carbon $start, Carbon $end, Collection $accounts) public function spentInPeriod(CRI $repository, $reportType, Carbon $start, Carbon $end, Collection $accounts)
{ {
$cache = new CacheProperties; // chart properties for cache: $cache = new CacheProperties; // chart properties for cache:
$cache->addProperty($start); $cache->addProperty($start);

View File

@@ -5,7 +5,7 @@ use Carbon\Carbon;
use FireflyIII\Helpers\Report\ReportQueryInterface; use FireflyIII\Helpers\Report\ReportQueryInterface;
use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface as CRI;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use FireflyIII\Repositories\Tag\TagRepositoryInterface; use FireflyIII\Repositories\Tag\TagRepositoryInterface;
use FireflyIII\Support\CacheProperties; use FireflyIII\Support\CacheProperties;
@@ -173,11 +173,11 @@ class JsonController extends Controller
/** /**
* Returns a list of categories. * Returns a list of categories.
* *
* @param CategoryRepositoryInterface $repository * @param CRI $repository
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*/ */
public function categories(CategoryRepositoryInterface $repository) public function categories(CRI $repository)
{ {
$list = $repository->getCategories(); $list = $repository->getCategories();
$return = []; $return = [];

View File

@@ -3,7 +3,6 @@
namespace FireflyIII\Repositories\Category; namespace FireflyIII\Repositories\Category;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Models\Category;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
@@ -27,6 +26,53 @@ interface CategoryRepositoryInterface
*/ */
public function earnedForAccounts(Collection $accounts, Carbon $start, Carbon $end); public function earnedForAccounts(Collection $accounts, Carbon $start, Carbon $end);
/**
* Returns a collection of Categories appended with the amount of money that has been earned
* in these categories, based on the $accounts involved, in period X, grouped per month.
* The amount earned in category X in period X is saved in field "earned".
*
* @param $accounts
* @param $start
* @param $end
*
* @return Collection
*/
public function earnedForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end);
/**
* Returns the amount earned without category by accounts in period.
*
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end
*
* @return string
*/
public function earnedNoCategoryForAccounts(Collection $accounts, Carbon $start, Carbon $end);
/**
* @return Collection
*/
public function getCategories();
/**
* Corrected for tags.
*
* @param Carbon $start
* @param Carbon $end
*
* @return array
*/
public function getCategoriesAndExpenses(Carbon $start, Carbon $end);
/**
* @param Carbon $start
* @param Carbon $end
*
* @return Collection
*/
public function getWithoutCategory(Carbon $start, Carbon $end);
/** /**
* Returns a collection of Categories appended with the amount of money that has been spent * Returns a collection of Categories appended with the amount of money that has been spent
* in these categories, based on the $accounts involved, in period X. * in these categories, based on the $accounts involved, in period X.
@@ -53,24 +99,6 @@ interface CategoryRepositoryInterface
*/ */
public function spentForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end); public function spentForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end);
/**
* Returns a collection of Categories appended with the amount of money that has been earned
* in these categories, based on the $accounts involved, in period X, grouped per month.
* The amount earned in category X in period X is saved in field "earned".
*
* @param $accounts
* @param $start
* @param $end
*
* @return Collection
*/
public function earnedForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end);
/**
* @return Collection
*/
public function getCategories();
/** /**
* Returns the amount spent without category by accounts in period. * Returns the amount spent without category by accounts in period.
* *
@@ -82,33 +110,4 @@ interface CategoryRepositoryInterface
*/ */
public function spentNoCategoryForAccounts(Collection $accounts, Carbon $start, Carbon $end); public function spentNoCategoryForAccounts(Collection $accounts, Carbon $start, Carbon $end);
/**
* Returns the amount earned without category by accounts in period.
*
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end
*
* @return string
*/
public function earnedNoCategoryForAccounts(Collection $accounts, Carbon $start, Carbon $end);
/**
* Corrected for tags.
*
* @param Carbon $start
* @param Carbon $end
*
* @return array
*/
public function getCategoriesAndExpenses(Carbon $start, Carbon $end);
/**
* @param Carbon $start
* @param Carbon $end
*
* @return Collection
*/
public function getWithoutCategory(Carbon $start, Carbon $end);
} }

View File

@@ -98,7 +98,6 @@ interface SingleCategoryRepositoryInterface
public function getJournals(Category $category, $page); public function getJournals(Category $category, $page);
/** /**
* @param Category $category * @param Category $category
* @param int $page * @param int $page

View File

@@ -76,6 +76,7 @@ class Steam
* Gets the balance for the given account during the whole range, using this format: * Gets the balance for the given account during the whole range, using this format:
* *
* [yyyy-mm-dd] => 123,2 * [yyyy-mm-dd] => 123,2
*
* @param Account $account * @param Account $account
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end