mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Code optimalisations.
This commit is contained in:
@@ -62,14 +62,14 @@ class RuleRequest extends Request
|
||||
$data['rule-triggers'][] = [
|
||||
'name' => $trigger['name'],
|
||||
'value' => $trigger['value'],
|
||||
'stop-processing' => (int)($trigger['stop-processing'] ?? 0) === 1,
|
||||
'stop-processing' => 1 === (int)($trigger['stop-processing'] ?? 0),
|
||||
];
|
||||
}
|
||||
foreach ($this->get('rule-actions') as $action) {
|
||||
$data['rule-actions'][] = [
|
||||
'name' => $action['name'],
|
||||
'value' => $action['value'],
|
||||
'stop-processing' => (int)($action['stop-processing'] ?? 0) === 1,
|
||||
'stop-processing' => 1 === (int)($action['stop-processing'] ?? 0),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ class RuleRequest extends Request
|
||||
$data = $validator->getData();
|
||||
$repetitions = $data['rule-actions'] ?? [];
|
||||
// need at least one transaction
|
||||
if (\count($repetitions) === 0) {
|
||||
if (0 === \count($repetitions)) {
|
||||
$validator->errors()->add('title', trans('validation.at_least_one_action'));
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,7 @@ class RuleRequest extends Request
|
||||
$data = $validator->getData();
|
||||
$repetitions = $data['rule-triggers'] ?? [];
|
||||
// need at least one transaction
|
||||
if (\count($repetitions) === 0) {
|
||||
if (0 === \count($repetitions)) {
|
||||
$validator->errors()->add('title', trans('validation.at_least_one_trigger'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user