mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Code cleanup.
This commit is contained in:
@@ -19,7 +19,7 @@ class AccountId extends BasicConverter implements ConverterInterface
|
||||
public function convert(): Account
|
||||
{
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface');
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$var = isset($this->mapped[$this->index][$this->value]) ? $this->mapped[$this->index][$this->value] : $this->value;
|
||||
$account = $repository->find($var);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class AssetAccountIban extends BasicConverter implements ConverterInterface
|
||||
public function convert(): Account
|
||||
{
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface');
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
|
||||
// is mapped? Then it's easy!
|
||||
if (isset($this->mapped[$this->index][$this->value])) {
|
||||
@@ -44,7 +44,6 @@ class AssetAccountIban extends BasicConverter implements ConverterInterface
|
||||
|
||||
/**
|
||||
* @param AccountRepositoryInterface $repository
|
||||
* @param $value
|
||||
*
|
||||
* @return Account
|
||||
*/
|
||||
|
||||
@@ -21,7 +21,7 @@ class AssetAccountName extends BasicConverter implements ConverterInterface
|
||||
public function convert(): Account
|
||||
{
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface');
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
if (isset($this->mapped[$this->index][$this->value])) {
|
||||
$account = $repository->find(intval($this->mapped[$this->index][$this->value]));
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class AssetAccountNumber extends BasicConverter implements ConverterInterface
|
||||
public function convert(): Account
|
||||
{
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface');
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
|
||||
// is mapped? Then it's easy!
|
||||
if (isset($this->mapped[$this->index][$this->value])) {
|
||||
|
||||
@@ -19,7 +19,7 @@ class BillId extends BasicConverter implements ConverterInterface
|
||||
public function convert(): Bill
|
||||
{
|
||||
/** @var BillRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Bill\BillRepositoryInterface');
|
||||
$repository = app(BillRepositoryInterface::class);
|
||||
$value = isset($this->mapped[$this->index][$this->value]) ? $this->mapped[$this->index][$this->value] : $this->value;
|
||||
$bill = $repository->find($value);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class BillName extends BasicConverter implements ConverterInterface
|
||||
public function convert(): Bill
|
||||
{
|
||||
/** @var BillRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Bill\BillRepositoryInterface');
|
||||
$repository = app(BillRepositoryInterface::class);
|
||||
|
||||
if (isset($this->mapped[$this->index][$this->value])) {
|
||||
return $repository->find($this->mapped[$this->index][$this->value]);
|
||||
|
||||
@@ -19,7 +19,7 @@ class BudgetId extends BasicConverter implements ConverterInterface
|
||||
public function convert(): Budget
|
||||
{
|
||||
/** @var BudgetRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
|
||||
$repository = app(BudgetRepositoryInterface::class);
|
||||
$value = isset($this->mapped[$this->index][$this->value]) ? $this->mapped[$this->index][$this->value] : $this->value;
|
||||
$budget = $repository->find($value);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ class BudgetName extends BasicConverter implements ConverterInterface
|
||||
public function convert(): Budget
|
||||
{
|
||||
/** @var BudgetRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
|
||||
$repository = app(BudgetRepositoryInterface::class);
|
||||
|
||||
// is mapped? Then it's easy!
|
||||
if (isset($this->mapped[$this->index][$this->value])) {
|
||||
|
||||
@@ -19,7 +19,7 @@ class CategoryId extends BasicConverter implements ConverterInterface
|
||||
public function convert(): Category
|
||||
{
|
||||
/** @var SingleCategoryRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Category\SingleCategoryRepositoryInterface');
|
||||
$repository = app(SingleCategoryRepositoryInterface::class);
|
||||
$value = isset($this->mapped[$this->index][$this->value]) ? $this->mapped[$this->index][$this->value] : $this->value;
|
||||
$category = $repository->find($value);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ class CategoryName extends BasicConverter implements ConverterInterface
|
||||
public function convert(): Category
|
||||
{
|
||||
/** @var SingleCategoryRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Category\SingleCategoryRepositoryInterface');
|
||||
$repository = app(SingleCategoryRepositoryInterface::class);
|
||||
|
||||
// is mapped? Then it's easy!
|
||||
if (isset($this->mapped[$this->index][$this->value])) {
|
||||
|
||||
@@ -19,7 +19,7 @@ class CurrencyCode extends BasicConverter implements ConverterInterface
|
||||
public function convert(): TransactionCurrency
|
||||
{
|
||||
/** @var CurrencyRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Currency\CurrencyRepositoryInterface');
|
||||
$repository = app(CurrencyRepositoryInterface::class);
|
||||
|
||||
if (isset($this->mapped[$this->index][$this->value])) {
|
||||
$currency = $repository->find($this->mapped[$this->index][$this->value]);
|
||||
|
||||
@@ -19,7 +19,7 @@ class CurrencyId extends BasicConverter implements ConverterInterface
|
||||
public function convert(): TransactionCurrency
|
||||
{
|
||||
/** @var CurrencyRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Currency\CurrencyRepositoryInterface');
|
||||
$repository = app(CurrencyRepositoryInterface::class);
|
||||
$value = isset($this->mapped[$this->index][$this->value]) ? $this->mapped[$this->index][$this->value] : $this->value;
|
||||
$currency = $repository->find($value);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class CurrencyName extends BasicConverter implements ConverterInterface
|
||||
public function convert(): TransactionCurrency
|
||||
{
|
||||
/** @var CurrencyRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Currency\CurrencyRepositoryInterface');
|
||||
$repository = app(CurrencyRepositoryInterface::class);
|
||||
|
||||
if (isset($this->mapped[$this->index][$this->value])) {
|
||||
$currency = $repository->find($this->mapped[$this->index][$this->value]);
|
||||
|
||||
@@ -19,7 +19,7 @@ class CurrencySymbol extends BasicConverter implements ConverterInterface
|
||||
public function convert(): TransactionCurrency
|
||||
{
|
||||
/** @var CurrencyRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Currency\CurrencyRepositoryInterface');
|
||||
$repository = app(CurrencyRepositoryInterface::class);
|
||||
|
||||
if (isset($this->mapped[$this->index][$this->value])) {
|
||||
$currency = $repository->find($this->mapped[$this->index][$this->value]);
|
||||
|
||||
@@ -21,7 +21,7 @@ class OpposingAccountIban extends BasicConverter implements ConverterInterface
|
||||
public function convert()
|
||||
{
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface');
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
|
||||
if (isset($this->mapped[$this->index][$this->value])) {
|
||||
$account = $repository->find($this->mapped[$this->index][$this->value]);
|
||||
|
||||
@@ -20,7 +20,7 @@ class OpposingAccountId extends BasicConverter implements ConverterInterface
|
||||
public function convert(): Account
|
||||
{
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface');
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$value = isset($this->mapped[$this->index][$this->value]) ? $this->mapped[$this->index][$this->value] : $this->value;
|
||||
$account = $repository->find($value);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class OpposingAccountName extends BasicConverter implements ConverterInterface
|
||||
public function convert()
|
||||
{
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface');
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
|
||||
if (isset($this->mapped[$this->index][$this->value])) {
|
||||
$account = $repository->find($this->mapped[$this->index][$this->value]);
|
||||
|
||||
@@ -19,7 +19,7 @@ class TagsComma extends BasicConverter implements ConverterInterface
|
||||
public function convert(): Collection
|
||||
{
|
||||
/** @var TagRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Tag\TagRepositoryInterface');
|
||||
$repository = app(TagRepositoryInterface::class);
|
||||
$tags = new Collection;
|
||||
|
||||
$strings = explode(',', $this->value);
|
||||
|
||||
@@ -19,7 +19,7 @@ class TagsSpace extends BasicConverter implements ConverterInterface
|
||||
public function convert(): Collection
|
||||
{
|
||||
/** @var TagRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Tag\TagRepositoryInterface');
|
||||
$repository = app(TagRepositoryInterface::class);
|
||||
|
||||
$tags = new Collection;
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ use Auth;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use Log;
|
||||
use Validator;
|
||||
|
||||
@@ -244,8 +245,8 @@ class AssetAccount implements PostProcessorInterface
|
||||
}
|
||||
}
|
||||
// create new if not exists and return that one:
|
||||
/** @var \FireflyIII\Repositories\Account\AccountRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface');
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$accountData = [
|
||||
'name' => $accountNumber,
|
||||
'accountType' => 'asset',
|
||||
|
||||
Reference in New Issue
Block a user