mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Various PSR12 code cleanup
This commit is contained in:
@@ -42,8 +42,8 @@ class UniqueAccountNumber implements Rule
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param Account|null $account
|
||||
* @param string|null $expectedType
|
||||
* @param Account|null $account
|
||||
* @param string|null $expectedType
|
||||
*/
|
||||
public function __construct(?Account $account, ?string $expectedType)
|
||||
{
|
||||
@@ -72,14 +72,14 @@ class UniqueAccountNumber implements Rule
|
||||
*/
|
||||
public function message(): string
|
||||
{
|
||||
return (string) trans('validation.unique_account_number_for_user');
|
||||
return (string)trans('validation.unique_account_number_for_user');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the validation rule passes.
|
||||
*
|
||||
* @param string $attribute
|
||||
* @param mixed $value
|
||||
* @param string $attribute
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
@@ -143,19 +143,19 @@ class UniqueAccountNumber implements Rule
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
* @param string $accountNumber
|
||||
* @param string $type
|
||||
* @param string $accountNumber
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
private function countHits(string $type, string $accountNumber): int
|
||||
{
|
||||
$query = AccountMeta::leftJoin('accounts', 'accounts.id', '=', 'account_meta.account_id')
|
||||
->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')
|
||||
->where('accounts.user_id', auth()->user()->id)
|
||||
->where('account_types.type', $type)
|
||||
->where('account_meta.name', '=', 'account_number')
|
||||
->where('account_meta.data', json_encode($accountNumber));
|
||||
->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')
|
||||
->where('accounts.user_id', auth()->user()->id)
|
||||
->where('account_types.type', $type)
|
||||
->where('account_meta.name', '=', 'account_number')
|
||||
->where('account_meta.data', json_encode($accountNumber));
|
||||
|
||||
if (null !== $this->account) {
|
||||
$query->where('accounts.id', '!=', $this->account->id);
|
||||
|
Reference in New Issue
Block a user