Refactor code.

This commit is contained in:
James Cole
2020-11-08 14:13:21 +01:00
parent ec44d0dc8e
commit 0f32761ae8
34 changed files with 45 additions and 750 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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
*

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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.
*

View File

@@ -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.
*

View File

@@ -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
*

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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

View File

@@ -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);
}