public function challengeRecording($subject, $ruleSet, string $keyPath = 'root')
    {
        $validate_by_rules = new ValidateAgainstRuleSet($this, [
            'recordFailure' => true,
        ]);

        $validate_by_rules->challenge($subject, $ruleSet, $keyPath);
        $record = $validate_by_rules->getRecord();

        return [
            'passed' => !$record,
            'record' => $record,
        ];
    }
public function challengeRecording($subject, $ruleSet, string $keyPath = 'root')
    {
        $validate_by_rules = new ValidateAgainstRuleSet($this, [
            'recordFailure' => true,
        ]);

        $validate_by_rules->challenge($subject, $ruleSet, $keyPath);
        $record = $validate_by_rules->getRecord();

        return [
            'passed' => !$record,
            'record' => $record,
        ];
    }
public function challengeRecording ( $ subject , $ ruleSet , string $ keyPath = 'root' ) { $ validate_by_rules = new ValidateAgainstRuleSet ( $ this , [ 'recordFailure' => true , ] ) ; $ validate_by_rules -> challenge ( $ subject , $ ruleSet , $ keyPath ) ; $ record = $ validate_by_rules -> getRecord ( ) ; return [ 'passed' => ! $ record , 'record' => $ record , ] ; }
Validate by a list of rules, recording validation failures.

Creates a new ValidateAgainstRuleSet instance on every call.

@code
$good_bike = Validate::make()->challengeRecording($bike, $rules);
if (empty($good_bike['passed'])) {
echo "Failed:\n" . join("\n", $good_bike['record']) . "\n";
}
@endcode

@param mixed $subject
@param ValidationRuleSet|array|object $ruleSet
@param string $keyPath
Name of element to validate, or key path to it.

@return array {
@var bool passed
@var array record
}

@throws \Throwable
Propagated.
Validate by a list of rules recording validation failures .