mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Some cleaning up.
This commit is contained in:
@@ -78,6 +78,7 @@ class PasswordController extends Controller
|
||||
|
||||
}
|
||||
abort(404);
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
|
@@ -4,8 +4,8 @@ use Auth;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Http\Requests\CategoryFormRequest;
|
||||
use FireflyIII\Models\Category;
|
||||
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
||||
use FireflyIII\Repositories\Category\SingleCategoryRepositoryInterface;
|
||||
use FireflyIII\Repositories\Category\CategoryRepositoryInterface as CRI;
|
||||
use FireflyIII\Repositories\Category\SingleCategoryRepositoryInterface as SCRI;
|
||||
use FireflyIII\Support\CacheProperties;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Collection;
|
||||
@@ -69,12 +69,12 @@ class CategoryController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param SingleCategoryRepositoryInterface $repository
|
||||
* @param Category $category
|
||||
* @param SCRI $repository
|
||||
* @param Category $category
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function destroy(SingleCategoryRepositoryInterface $repository, Category $category)
|
||||
public function destroy(SCRI $repository, Category $category)
|
||||
{
|
||||
|
||||
$name = $category->name;
|
||||
@@ -108,12 +108,12 @@ class CategoryController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param CategoryRepositoryInterface $repository
|
||||
* @param SingleCategoryRepositoryInterface $singleRepository
|
||||
* @param CRI $repository
|
||||
* @param SCRI $singleRepository
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function index(CategoryRepositoryInterface $repository, SingleCategoryRepositoryInterface $singleRepository)
|
||||
public function index(CRI $repository, SCRI $singleRepository)
|
||||
{
|
||||
$categories = $repository->getCategories();
|
||||
|
||||
@@ -127,11 +127,11 @@ class CategoryController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param CategoryRepositoryInterface $repository
|
||||
* @param CRI $repository
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function noCategory(CategoryRepositoryInterface $repository)
|
||||
public function noCategory(CRI $repository)
|
||||
{
|
||||
$start = Session::get('start', Carbon::now()->startOfMonth());
|
||||
$end = Session::get('end', Carbon::now()->startOfMonth());
|
||||
@@ -145,14 +145,14 @@ class CategoryController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param SingleCategoryRepositoryInterface $repository
|
||||
* @param Category $category
|
||||
* @param SCRI $repository
|
||||
* @param Category $category
|
||||
*
|
||||
* @param $date
|
||||
* @param $date
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function showWithDate(SingleCategoryRepositoryInterface $repository, Category $category, $date)
|
||||
public function showWithDate(SCRI $repository, Category $category, $date)
|
||||
{
|
||||
$carbon = new Carbon($date);
|
||||
$range = Preferences::get('viewRange', '1M')->data;
|
||||
@@ -172,12 +172,12 @@ class CategoryController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param SingleCategoryRepositoryInterface $repository
|
||||
* @param Category $category
|
||||
* @param SCRI $repository
|
||||
* @param Category $category
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function show(SingleCategoryRepositoryInterface $repository, Category $category)
|
||||
public function show(SCRI $repository, Category $category)
|
||||
{
|
||||
$hideCategory = true; // used in list.
|
||||
$page = intval(Input::get('page'));
|
||||
@@ -227,12 +227,12 @@ class CategoryController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param CategoryFormRequest $request
|
||||
* @param SingleCategoryRepositoryInterface $repository
|
||||
* @param CategoryFormRequest $request
|
||||
* @param SCRI $repository
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function store(CategoryFormRequest $request, SingleCategoryRepositoryInterface $repository)
|
||||
public function store(CategoryFormRequest $request, SCRI $repository)
|
||||
{
|
||||
$categoryData = [
|
||||
'name' => $request->input('name'),
|
||||
@@ -254,13 +254,13 @@ class CategoryController extends Controller
|
||||
|
||||
|
||||
/**
|
||||
* @param CategoryFormRequest $request
|
||||
* @param SingleCategoryRepositoryInterface $repository
|
||||
* @param Category $category
|
||||
* @param CategoryFormRequest $request
|
||||
* @param SCRI $repository
|
||||
* @param Category $category
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function update(CategoryFormRequest $request, SingleCategoryRepositoryInterface $repository, Category $category)
|
||||
public function update(CategoryFormRequest $request, SCRI $repository, Category $category)
|
||||
{
|
||||
$categoryData = [
|
||||
'name' => $request->input('name'),
|
||||
|
@@ -6,8 +6,8 @@ namespace FireflyIII\Http\Controllers\Chart;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Models\Category;
|
||||
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
||||
use FireflyIII\Repositories\Category\SingleCategoryRepositoryInterface;
|
||||
use FireflyIII\Repositories\Category\CategoryRepositoryInterface as CRI;
|
||||
use FireflyIII\Repositories\Category\SingleCategoryRepositoryInterface as SCRI;
|
||||
use FireflyIII\Support\CacheProperties;
|
||||
use Illuminate\Support\Collection;
|
||||
use Navigation;
|
||||
@@ -39,12 +39,12 @@ class CategoryController extends Controller
|
||||
/**
|
||||
* Show an overview for a category for all time, per month/week/year.
|
||||
*
|
||||
* @param SingleCategoryRepositoryInterface $repository
|
||||
* @param Category $category
|
||||
* @param SCRI $repository
|
||||
* @param Category $category
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function all(SingleCategoryRepositoryInterface $repository, Category $category)
|
||||
public function all(SCRI $repository, Category $category)
|
||||
{
|
||||
// oldest transaction in category:
|
||||
$start = $repository->getFirstActivityDate($category);
|
||||
@@ -88,11 +88,11 @@ class CategoryController extends Controller
|
||||
/**
|
||||
* Show this month's category overview.
|
||||
*
|
||||
* @param CategoryRepositoryInterface $repository
|
||||
* @param CRI $repository
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function frontpage(CategoryRepositoryInterface $repository)
|
||||
public function frontpage(CRI $repository)
|
||||
{
|
||||
|
||||
$start = Session::get('start', Carbon::now()->startOfMonth());
|
||||
@@ -212,12 +212,12 @@ class CategoryController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param SingleCategoryRepositoryInterface $repository
|
||||
* @param Category $category
|
||||
* @param SCRI $repository
|
||||
* @param Category $category
|
||||
*
|
||||
* @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());
|
||||
$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 $date
|
||||
*
|
||||
* @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);
|
||||
$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
|
||||
* grouped by month.
|
||||
*
|
||||
* @param CategoryRepositoryInterface $repository
|
||||
* @param CRI $repository
|
||||
* @param $reportType
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
@@ -308,7 +308,7 @@ class CategoryController extends Controller
|
||||
*
|
||||
* @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->addProperty($start);
|
||||
@@ -367,7 +367,7 @@ class CategoryController extends Controller
|
||||
* Returns a chart of what has been spent in this period in each category
|
||||
* grouped by month.
|
||||
*
|
||||
* @param CategoryRepositoryInterface $repository
|
||||
* @param CRI $repository
|
||||
* @param $reportType
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
@@ -375,7 +375,7 @@ class CategoryController extends Controller
|
||||
*
|
||||
* @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->addProperty($start);
|
||||
|
@@ -5,7 +5,7 @@ use Carbon\Carbon;
|
||||
use FireflyIII\Helpers\Report\ReportQueryInterface;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
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\Tag\TagRepositoryInterface;
|
||||
use FireflyIII\Support\CacheProperties;
|
||||
@@ -60,7 +60,7 @@ class JsonController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BillRepositoryInterface $repository
|
||||
* @param BillRepositoryInterface $repository
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
@@ -173,11 +173,11 @@ class JsonController extends Controller
|
||||
/**
|
||||
* Returns a list of categories.
|
||||
*
|
||||
* @param CategoryRepositoryInterface $repository
|
||||
* @param CRI $repository
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function categories(CategoryRepositoryInterface $repository)
|
||||
public function categories(CRI $repository)
|
||||
{
|
||||
$list = $repository->getCategories();
|
||||
$return = [];
|
||||
|
@@ -66,9 +66,9 @@ class ReportController extends Controller
|
||||
|
||||
return view(
|
||||
'reports.index', compact(
|
||||
'months', 'accounts', 'start', 'accountList',
|
||||
'startOfMonth', 'endOfMonth', 'startOfYear', 'endOfYear'
|
||||
)
|
||||
'months', 'accounts', 'start', 'accountList',
|
||||
'startOfMonth', 'endOfMonth', 'startOfYear', 'endOfYear'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user