PHPStorm can order methods by alphabet, who knew.

This commit is contained in:
James Cole
2024-02-22 20:11:09 +01:00
parent f9d4a43e05
commit 68c9c4ec3c
221 changed files with 5840 additions and 5843 deletions

View File

@@ -58,6 +58,28 @@ class RuleFormRequest extends FormRequest
];
}
private function getRuleTriggerData(): array
{
$return = [];
$triggerData = $this->get('triggers');
if (is_array($triggerData)) {
foreach ($triggerData as $trigger) {
$stopProcessing = $trigger['stop_processing'] ?? '0';
$prohibited = $trigger['prohibited'] ?? '0';
$set = [
'type' => $trigger['type'] ?? 'invalid',
'value' => $trigger['value'] ?? '',
'stop_processing' => 1 === (int)$stopProcessing,
'prohibited' => 1 === (int)$prohibited,
];
$set = self::replaceAmountTrigger($set);
$return[] = $set;
}
}
return $return;
}
public static function replaceAmountTrigger(array $array): array
{
// do some sneaky search and replace.
@@ -83,6 +105,24 @@ class RuleFormRequest extends FormRequest
return $array;
}
private function getRuleActionData(): array
{
$return = [];
$actionData = $this->get('actions');
if (is_array($actionData)) {
foreach ($actionData as $action) {
$stopProcessing = $action['stop_processing'] ?? '0';
$return[] = [
'type' => $action['type'] ?? 'invalid',
'value' => $action['value'] ?? '',
'stop_processing' => 1 === (int)$stopProcessing,
];
}
}
return $return;
}
/**
* Rules for this request.
*/
@@ -127,44 +167,4 @@ class RuleFormRequest extends FormRequest
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
private function getRuleTriggerData(): array
{
$return = [];
$triggerData = $this->get('triggers');
if (is_array($triggerData)) {
foreach ($triggerData as $trigger) {
$stopProcessing = $trigger['stop_processing'] ?? '0';
$prohibited = $trigger['prohibited'] ?? '0';
$set = [
'type' => $trigger['type'] ?? 'invalid',
'value' => $trigger['value'] ?? '',
'stop_processing' => 1 === (int) $stopProcessing,
'prohibited' => 1 === (int) $prohibited,
];
$set = self::replaceAmountTrigger($set);
$return[] = $set;
}
}
return $return;
}
private function getRuleActionData(): array
{
$return = [];
$actionData = $this->get('actions');
if (is_array($actionData)) {
foreach ($actionData as $action) {
$stopProcessing = $action['stop_processing'] ?? '0';
$return[] = [
'type' => $action['type'] ?? 'invalid',
'value' => $action['value'] ?? '',
'stop_processing' => 1 === (int) $stopProcessing,
];
}
}
return $return;
}
}