src/Validators/MiscValidators/OneOfValidator.php
public function validate($subject): bool
    {
        $validatedCount = 0;
        foreach ($this->schema['oneOf'] as $schema) {
            $nodeValidator = new NodeValidator($schema, $this->rootSchema);
            if ($nodeValidator->validate($subject)) {
                $validatedCount++;
            }
        }
        return $validatedCount === 1;
    }
public function validate($subject): bool
    {
        $validatedCount = 0;
        foreach ($this->schema['oneOf'] as $schema) {
            $nodeValidator = new NodeValidator($schema, $this->rootSchema);
            if ($nodeValidator->validate($subject)) {
                $validatedCount++;
            }
        }
        return $validatedCount === 1;
    }
public function validate ( $ subject ) : bool { $ validatedCount = 0 ; foreach ( $ this -> schema [ 'oneOf' ] as $ schema ) { $ nodeValidator = new NodeValidator ( $ schema , $ this -> rootSchema ) ; if ( $ nodeValidator -> validate ( $ subject ) ) { $ validatedCount ++ ; } } return $ validatedCount === 1 ; }
Validates subject against oneOf

@param $subject
@return bool
Validates subject against oneOf