MailPoet\EmailEditor\Validator\Schema

Any_Of_Schema::non_nullable()publicWC 1.0

Returns the schema as an array.

Method of the class: Any_Of_Schema{}

No Hooks.

Return

null. Nothing (null).

Usage

$Any_Of_Schema = new Any_Of_Schema();
$Any_Of_Schema->non_nullable(): self;

Any_Of_Schema::non_nullable() code WC 9.8.1

public function non_nullable(): self {
	$null   = array( 'type' => 'null' );
	$any_of = $this->schema['any_of'];
	$value  = array_filter(
		$any_of,
		function ( $item ) use ( $null ) {
			return $item !== $null;
		}
	);
	return $this->update_schema_property( 'any_of', $value );
}