mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 22:21:42 +00:00
Refactor code.
This commit is contained in:
@@ -39,16 +39,6 @@ class AccountTasker implements AccountTaskerInterface
|
||||
/** @var User */
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $accounts
|
||||
* @param Carbon $start
|
||||
|
||||
@@ -40,17 +40,6 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
/** @var User */
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
die(__METHOD__);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns a list of all the withdrawal transaction journals (as arrays) set in that period
|
||||
* which have the specified accounts. It's grouped per currency, with as few details in the array
|
||||
|
||||
@@ -45,16 +45,6 @@ class AttachmentRepository implements AttachmentRepositoryInterface
|
||||
/** @var User */
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Attachment $attachment
|
||||
*
|
||||
|
||||
@@ -41,17 +41,6 @@ class NoBudgetRepository implements NoBudgetRepositoryInterface
|
||||
/** @var User */
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
die(get_class($this));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $accounts
|
||||
* @param Carbon $start
|
||||
|
||||
@@ -40,17 +40,6 @@ class NoCategoryRepository implements NoCategoryRepositoryInterface
|
||||
/** @var User */
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
die(__METHOD__);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns a list of all the withdrawal transaction journals (as arrays) set in that period
|
||||
* which have no category set to them. It's grouped per currency, with as few details in the array
|
||||
|
||||
@@ -40,17 +40,6 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
/** @var User */
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
die(__METHOD__);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns a list of all the withdrawal transaction journals (as arrays) set in that period
|
||||
* which have the specified category set to them. It's grouped per currency, with as few details in the array
|
||||
|
||||
@@ -42,16 +42,6 @@ class JournalCLIRepository implements JournalCLIRepositoryInterface
|
||||
/** @var User */
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all transaction journals with a specific type, regardless of user.
|
||||
*
|
||||
|
||||
@@ -49,16 +49,6 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
/** @var User */
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Search in journal descriptions.
|
||||
*
|
||||
|
||||
@@ -40,16 +40,6 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface
|
||||
/** @var User */
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param LinkType $linkType
|
||||
*
|
||||
|
||||
@@ -39,16 +39,6 @@ class ObjectGroupRepository implements ObjectGroupRepositoryInterface
|
||||
/** @var User */
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
@@ -41,16 +41,6 @@ class RuleRepository implements RuleRepositoryInterface
|
||||
/** @var User */
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
|
||||
@@ -37,16 +37,6 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface
|
||||
/** @var User */
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
|
||||
@@ -40,17 +40,6 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
/** @var User */
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
die(__METHOD__);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns a list of all the withdrawal transaction journals (as arrays) set in that period
|
||||
* which have the specified tag(s) set to them. It's grouped per currency, with as few details in the array
|
||||
|
||||
@@ -53,25 +53,13 @@ use Log;
|
||||
*/
|
||||
class TransactionGroupRepository implements TransactionGroupRepositoryInterface
|
||||
{
|
||||
/** @var User */
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ('testing' === config('app.env')) {
|
||||
app('log')->warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
}
|
||||
}
|
||||
private User $user;
|
||||
|
||||
/**
|
||||
* @param TransactionGroup $group
|
||||
*/
|
||||
public function destroy(TransactionGroup $group): void
|
||||
{
|
||||
/** @var TransactionGroupDestroyService $service */
|
||||
$service = new TransactionGroupDestroyService;
|
||||
$service->destroy($group);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user