mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 08:35:00 +00:00
Reformat various code.
This commit is contained in:
@@ -54,47 +54,6 @@ use function is_string;
|
||||
class FireflyValidator extends Validator
|
||||
{
|
||||
|
||||
/**
|
||||
* @param $attribute
|
||||
* @param $value
|
||||
* @return bool
|
||||
*/
|
||||
public function validateUniqueCurrencyName($attribute, $value): bool
|
||||
{
|
||||
return $this->validateUniqueCurrency('name', (string) $attribute, (string) $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $attribute
|
||||
* @param $value
|
||||
* @return bool
|
||||
*/
|
||||
public function validateUniqueCurrencyCode($attribute, $value): bool
|
||||
{
|
||||
return $this->validateUniqueCurrency('code', (string) $attribute, (string) $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $attribute
|
||||
* @param $value
|
||||
* @return bool
|
||||
*/
|
||||
public function validateUniqueCurrencySymbol($attribute, $value): bool
|
||||
{
|
||||
return $this->validateUniqueCurrency('symbol', (string) $attribute, (string) $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $attribute
|
||||
* @param $value
|
||||
* @return bool
|
||||
*/
|
||||
public function validateUniqueCurrency(string $field, string $attribute, string $value): bool
|
||||
{
|
||||
return 0 === DB::table('transaction_currencies')->where($field, $value)->whereNull('deleted_at')->count();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $attribute
|
||||
* @param mixed $value
|
||||
@@ -648,6 +607,46 @@ class FireflyValidator extends Validator
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $attribute
|
||||
* @param $value
|
||||
* @return bool
|
||||
*/
|
||||
public function validateUniqueCurrencyCode($attribute, $value): bool
|
||||
{
|
||||
return $this->validateUniqueCurrency('code', (string) $attribute, (string) $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $attribute
|
||||
* @param $value
|
||||
* @return bool
|
||||
*/
|
||||
public function validateUniqueCurrencyName($attribute, $value): bool
|
||||
{
|
||||
return $this->validateUniqueCurrency('name', (string) $attribute, (string) $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $attribute
|
||||
* @param $value
|
||||
* @return bool
|
||||
*/
|
||||
public function validateUniqueCurrency(string $field, string $attribute, string $value): bool
|
||||
{
|
||||
return 0 === DB::table('transaction_currencies')->where($field, $value)->whereNull('deleted_at')->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $attribute
|
||||
* @param $value
|
||||
* @return bool
|
||||
*/
|
||||
public function validateUniqueCurrencySymbol($attribute, $value): bool
|
||||
{
|
||||
return $this->validateUniqueCurrency('symbol', (string) $attribute, (string) $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
* @param mixed $parameters
|
||||
|
Reference in New Issue
Block a user