mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 12:12:18 +00:00
Optimise code.
This commit is contained in:
@@ -29,26 +29,19 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\User;
|
||||
|
||||
/**
|
||||
* I have no idea what made me do this. I'll reverse it some day.
|
||||
*
|
||||
* Trait AccountValidatorProperties
|
||||
*/
|
||||
trait AccountValidatorProperties
|
||||
{
|
||||
/** @var bool */
|
||||
public $createMode;
|
||||
/** @var string */
|
||||
public $destError;
|
||||
/** @var Account */
|
||||
public $destination;
|
||||
/** @var Account */
|
||||
public $source;
|
||||
/** @var string */
|
||||
public $sourceError;
|
||||
/** @var AccountRepositoryInterface */
|
||||
private $accountRepository;
|
||||
/** @var array */
|
||||
private $combinations;
|
||||
/** @var string */
|
||||
private $transactionType;
|
||||
/** @var User */
|
||||
private $user;
|
||||
public bool $createMode;
|
||||
public string $destError;
|
||||
public Account $destination;
|
||||
public Account $source;
|
||||
public string $sourceError;
|
||||
private AccountRepositoryInterface $accountRepository;
|
||||
private array $combinations;
|
||||
private string $transactionType;
|
||||
private User $user;
|
||||
}
|
||||
|
@@ -96,8 +96,6 @@ trait TransactionValidation
|
||||
if (false === $validDestination) {
|
||||
$validator->errors()->add(sprintf('transactions.%d.destination_id', $index), $accountValidator->destError);
|
||||
$validator->errors()->add(sprintf('transactions.%d.destination_name', $index), $accountValidator->destError);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,8 +255,6 @@ trait TransactionValidation
|
||||
$unique = array_unique($types);
|
||||
if (count($unique) > 1) {
|
||||
$validator->errors()->add('transactions.0.type', (string) trans('validation.transaction_types_equal'));
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user