protected function runValidator(stdClass $data, stdClass $schema): void
    {
        $config = $this->getConfig();

        $validator = new Validator;
        $validator->validate($data, $schema, $config['validationMode']);

        if (!$validator->isValid()) {
            foreach ($validator->getErrors() as $error) {
                $this->errors[] = sprintf('[%s]: %s', $error['pointer'], $error['message']);
            }

            throw new JsonValidationException('Failed to validate json data against the schema.');
        }
    }
protected function runValidator(stdClass $data, stdClass $schema): void
    {
        $config = $this->getConfig();

        $validator = new Validator;
        $validator->validate($data, $schema, $config['validationMode']);

        if (!$validator->isValid()) {
            foreach ($validator->getErrors() as $error) {
                $this->errors[] = sprintf('[%s]: %s', $error['pointer'], $error['message']);
            }

            throw new JsonValidationException('Failed to validate json data against the schema.');
        }
    }
protected function runValidator ( stdClass $ data , stdClass $ schema ) : void { $ config = $ this -> getConfig ( ) ; $ validator = new Validator ; $ validator -> validate ( $ data , $ schema , $ config [ 'validationMode' ] ) ; if ( ! $ validator -> isValid ( ) ) { foreach ( $ validator -> getErrors ( ) as $ error ) { $ this -> errors [ ] = sprintf ( '[%s]: %s' , $ error [ 'pointer' ] , $ error [ 'message' ] ) ; } throw new JsonValidationException ( 'Failed to validate json data against the schema.' ) ; } }
Runs the json validation.

@param stdClass $data Data to validate against a schema.
@param stdClass $schema The schema which is used to validate the data.
@throws \Qobo\Utils\ModuleConfig\Parser\JsonValidationException When the validation fails.
@return void
Runs the json validation .