mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Reformat various code.
This commit is contained in:
@@ -42,7 +42,7 @@ class IsValidBulkClause implements Rule
|
||||
public function __construct(string $type)
|
||||
{
|
||||
$this->rules = config(sprintf('bulk.%s', $type));
|
||||
$this->error = (string)trans('firefly.belongs_user');
|
||||
$this->error = (string) trans('firefly.belongs_user');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,7 +61,7 @@ class IsValidBulkClause implements Rule
|
||||
*/
|
||||
public function passes($attribute, $value): bool
|
||||
{
|
||||
$result = $this->basicValidation((string)$value);
|
||||
$result = $this->basicValidation((string) $value);
|
||||
if (false === $result) {
|
||||
return false;
|
||||
}
|
||||
@@ -81,14 +81,14 @@ class IsValidBulkClause implements Rule
|
||||
try {
|
||||
$array = json_decode($value, true, 8, JSON_THROW_ON_ERROR);
|
||||
} catch (JsonException $e) {
|
||||
$this->error = (string)trans('validation.json');
|
||||
$this->error = (string) trans('validation.json');
|
||||
|
||||
return false;
|
||||
}
|
||||
$clauses = ['where', 'update'];
|
||||
foreach ($clauses as $clause) {
|
||||
if (!array_key_exists($clause, $array)) {
|
||||
$this->error = (string)trans(sprintf('validation.missing_%s', $clause));
|
||||
$this->error = (string) trans(sprintf('validation.missing_%s', $clause));
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -98,7 +98,7 @@ class IsValidBulkClause implements Rule
|
||||
*/
|
||||
foreach ($array[$clause] as $arrayKey => $arrayValue) {
|
||||
if (!array_key_exists($arrayKey, $this->rules[$clause])) {
|
||||
$this->error = (string)trans(sprintf('validation.invalid_%s_key', $clause));
|
||||
$this->error = (string) trans(sprintf('validation.invalid_%s_key', $clause));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user