mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 22:21:42 +00:00
Use PSR-12 code style
This commit is contained in:
@@ -154,7 +154,6 @@ class BelongsUser implements Rule
|
||||
if (PiggyBank::class === $class) {
|
||||
$objects = PiggyBank::leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id')
|
||||
->where('accounts.user_id', '=', auth()->user()->id)->get(['piggy_banks.*']);
|
||||
|
||||
}
|
||||
if (PiggyBank::class !== $class) {
|
||||
$objects = $class::where('user_id', '=', auth()->user()->id)->get();
|
||||
|
||||
@@ -61,7 +61,7 @@ class IsBoolean implements Rule
|
||||
if (is_int($value) && 1 === $value) {
|
||||
return true;
|
||||
}
|
||||
if (is_string($value) && in_array($value, ['0', '1', 'true', 'false', 'on', 'off', 'yes', 'no', 'y', 'n'])) {
|
||||
if (is_string($value) && in_array($value, ['0', '1', 'true', 'false', 'on', 'off', 'yes', 'no', 'y', 'n'], true)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ use Log;
|
||||
*/
|
||||
class IsDateOrTime implements Rule
|
||||
{
|
||||
|
||||
/**
|
||||
* Get the validation error message.
|
||||
*
|
||||
|
||||
@@ -101,7 +101,10 @@ class UniqueAccountNumber implements Rule
|
||||
Log::debug(
|
||||
sprintf(
|
||||
'account number "%s" is in use with %d account(s) of type "%s", which is too much for expected type "%s"',
|
||||
$value, $count, $type, $this->expectedType
|
||||
$value,
|
||||
$count,
|
||||
$type,
|
||||
$this->expectedType
|
||||
)
|
||||
);
|
||||
|
||||
@@ -147,8 +150,7 @@ class UniqueAccountNumber implements Rule
|
||||
*/
|
||||
private function countHits(string $type, string $accountNumber): int
|
||||
{
|
||||
$query = AccountMeta
|
||||
::leftJoin('accounts', 'accounts.id', '=', 'account_meta.account_id')
|
||||
$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)
|
||||
|
||||
@@ -98,7 +98,10 @@ class UniqueIban implements Rule
|
||||
Log::debug(
|
||||
sprintf(
|
||||
'IBAN "%s" is in use with %d account(s) of type "%s", which is too much for expected type "%s"',
|
||||
$value, $count, $type, $this->expectedType
|
||||
$value,
|
||||
$count,
|
||||
$type,
|
||||
$this->expectedType
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ use Illuminate\Contracts\Validation\Rule;
|
||||
*/
|
||||
class ValidRecurrenceRepetitionType implements Rule
|
||||
{
|
||||
|
||||
/**
|
||||
* Get the validation error message.
|
||||
*
|
||||
@@ -60,7 +59,7 @@ class ValidRecurrenceRepetitionType implements Rule
|
||||
}
|
||||
//monthly,17
|
||||
//ndom,3,7
|
||||
if (in_array(substr($value, 0, 6), ['yearly', 'weekly'])) {
|
||||
if (in_array(substr($value, 0, 6), ['yearly', 'weekly'], true)) {
|
||||
return true;
|
||||
}
|
||||
if (str_starts_with($value, 'monthly')) {
|
||||
|
||||
@@ -35,7 +35,6 @@ use Log;
|
||||
*/
|
||||
class ValidRecurrenceRepetitionValue implements Rule
|
||||
{
|
||||
|
||||
/**
|
||||
* Get the validation error message.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user