Reformat various code.

This commit is contained in:
James Cole
2022-03-29 14:59:58 +02:00
parent 29bed2547c
commit d1a09ff33b
115 changed files with 2700 additions and 2699 deletions

View File

@@ -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;
}