Automattic\WooCommerce\EmailEditor\Validator\Schema

One_Of_Schema::non_nullablepublicWC 1.0

Sets the schema as non-nullable.

Метод класса: One_Of_Schema{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

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

Код One_Of_Schema::non_nullable() WC 10.4.3

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