$this->rules =
$this->
fillPlaceholders($this->rules,
$data);
// Need this for searching arrays in validation.
helper('array'
);
// Run through each rule. If we have any field set for
// this rule, then we need to run them through!
foreach ($this->rules
as $field =>
$setup) { $rules =
$setup['rules'
];
if (is_string($rules)) { $rules =
$this->
splitRules($rules);
} if (strpos($field, '*'
) !== false
) { $values =
array_filter(array_flatten_with_dots($data),
static fn ($key) =>
preg_match( '/^'
.
str_replace(['\.\*', '\*\.'
],
['\..+', '.+\.'
],
preg_quote($field, '/'
)) . '$/',
$key ), ARRAY_FILTER_USE_KEY
);
// if keys not found
$values =
$values ?:
[$field => null
];
}