MailPoet\EmailEditor\Validator

Validator::validate()publicWC 1.0

Strict validation & sanitization implementation. It only coerces int to float (e.g. 5 to 5.0).

Method of the class: Validator{}

No Hooks.

Return

Mixed.

Usage

$Validator = new Validator();
$Validator->validate( $schema, $value, $param_name );
$schema(Schema) (required)
The schema to validate against.
$value(mixed) (required)
The value to validate.
$param_name(string)
The parameter name.
Default: 'value'

Validator::validate() code WC 9.8.1

public function validate( Schema $schema, $value, string $param_name = 'value' ) {
	return $this->validate_schema_array( $schema->to_array(), $value, $param_name );
}