Skip to content

Commit

Permalink
Rename variable to
Browse files Browse the repository at this point in the history
  • Loading branch information
CWAscend committed Aug 19, 2024
1 parent d12665d commit d96851e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Resolvers/DataValidationRulesResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,19 +241,19 @@ protected function resolveRules(
$path
);

$rulesFromRulesMethod = app()->call([$class->name, 'rules'], ['context' => $validationContext]);
$manualRules = app()->call([$class->name, 'rules'], ['context' => $validationContext]);

if ($this->shouldMergeRules($class)) {
$rulesFromRulesMethod = collect($rulesFromRulesMethod)->map(
$manualRules = collect($manualRules)->map(
fn (string|array $rules) => is_array($rules) ? $rules : explode('|', $rules)
)->all();

$dataRules->rules = array_merge_recursive($dataRules->rules, $rulesFromRulesMethod);
$dataRules->rules = array_merge_recursive($dataRules->rules, $manualRules);

return;
}

foreach ($rulesFromRulesMethod as $key => $rules) {
foreach ($manualRules as $key => $rules) {
if (in_array($key, $withoutValidationProperties)) {
continue;
}
Expand Down

0 comments on commit d96851e

Please sign in to comment.