MailPoet\EmailEditor\Validator

Schema::to_string()publicWC 1.0

Returns the schema as a JSON string.

Method of the class: Schema{}

No Hooks.

Return

null. Nothing (null).

Usage

$Schema = new Schema();
$Schema->to_string(): string;

Schema::to_string() code WC 9.8.1

public function to_string(): string {
	$json  = wp_json_encode( $this->schema, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRESERVE_ZERO_FRACTION );
	$error = json_last_error();
	if ( $error || false === $json ) {
		throw new \Exception( \esc_html( json_last_error_msg() ), 0 );
	}
	return $json;
}