Clean up some code.

This commit is contained in:
James Cole
2020-10-13 06:35:33 +02:00
parent 3bd5ac21c9
commit 4e51f0abc4
33 changed files with 149 additions and 294 deletions

View File

@@ -23,7 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Recurring;
use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller;
@@ -45,12 +44,9 @@ use Illuminate\View\View;
*/
class CreateController extends Controller
{
/** @var BudgetRepositoryInterface The budget repository */
private $budgets;
/** @var RecurringRepositoryInterface Recurring repository */
private $recurring;
private AttachmentHelperInterface $attachments;
private BudgetRepositoryInterface $budgetRepos;
private RecurringRepositoryInterface $recurring;
private AttachmentHelperInterface $attachments;
/**
* CreateController constructor.
@@ -69,7 +65,7 @@ class CreateController extends Controller
app('view')->share('subTitle', (string) trans('firefly.create_new_recurrence'));
$this->recurring = app(RecurringRepositoryInterface::class);
$this->budgets = app(BudgetRepositoryInterface::class);
$this->budgetRepos = app(BudgetRepositoryInterface::class);
$this->attachments = app(AttachmentHelperInterface::class);
return $next($request);
@@ -83,7 +79,7 @@ class CreateController extends Controller
*/
public function createFromJournal(Request $request, TransactionJournal $journal)
{
$budgets = app('expandedform')->makeSelectListWithEmpty($this->budgets->getActiveBudgets());
$budgets = app('expandedform')->makeSelectListWithEmpty($this->budgetRepos->getActiveBudgets());
$defaultCurrency = app('amount')->getDefaultCurrency();
$tomorrow = today(config('app.timezone'));
$oldRepetitionType = $request->old('repetition_type');
@@ -177,7 +173,7 @@ class CreateController extends Controller
*/
public function create(Request $request)
{
$budgets = app('expandedform')->makeSelectListWithEmpty($this->budgets->getActiveBudgets());
$budgets = app('expandedform')->makeSelectListWithEmpty($this->budgetRepos->getActiveBudgets());
$defaultCurrency = app('amount')->getDefaultCurrency();
$tomorrow = today(config('app.timezone'));
$oldRepetitionType = $request->old('repetition_type');