mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-22 20:16:22 +00:00
Refactor code.
This commit is contained in:
@@ -41,10 +41,8 @@ class RecurrenceFactory
|
||||
{
|
||||
|
||||
use TransactionTypeTrait, RecurringTransactionTrait;
|
||||
/** @var MessageBag */
|
||||
private $errors;
|
||||
/** @var User */
|
||||
private $user;
|
||||
private MessageBag $errors;
|
||||
private User $user;
|
||||
|
||||
|
||||
/**
|
||||
@@ -54,9 +52,6 @@ class RecurrenceFactory
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
}
|
||||
$this->errors = new MessageBag;
|
||||
}
|
||||
|
||||
|
@@ -38,18 +38,12 @@ use Log;
|
||||
*/
|
||||
class TransactionFactory
|
||||
{
|
||||
/** @var Account */
|
||||
private $account;
|
||||
/** @var TransactionCurrency */
|
||||
private $currency;
|
||||
/** @var TransactionCurrency */
|
||||
private $foreignCurrency;
|
||||
/** @var TransactionJournal */
|
||||
private $journal;
|
||||
/** @var bool */
|
||||
private $reconciled;
|
||||
/** @var User */
|
||||
private $user;
|
||||
private Account $account;
|
||||
private TransactionCurrency $currency;
|
||||
private TransactionCurrency $foreignCurrency;
|
||||
private TransactionJournal $journal;
|
||||
private bool $reconciled;
|
||||
private User $user;
|
||||
|
||||
|
||||
/**
|
||||
@@ -59,9 +53,6 @@ class TransactionFactory
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
}
|
||||
$this->reconciled = false;
|
||||
}
|
||||
|
||||
|
@@ -95,10 +95,6 @@ class TransactionJournalFactory
|
||||
];
|
||||
|
||||
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
}
|
||||
|
||||
$this->currencyRepository = app(CurrencyRepositoryInterface::class);
|
||||
$this->typeRepository = app(TransactionTypeRepositoryInterface::class);
|
||||
$this->billRepository = app(BillRepositoryInterface::class);
|
||||
|
@@ -34,18 +34,6 @@ use Log;
|
||||
*/
|
||||
class TransactionJournalMetaFactory
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
*
|
||||
|
@@ -33,18 +33,6 @@ use Log;
|
||||
*/
|
||||
class TransactionTypeFactory
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
*
|
||||
|
Reference in New Issue
Block a user