<?php
/**
 * Registered custom metadata module boundary.
 *
 * @package ScheduledChanges
 */

namespace ScheduledChanges\WordPressContent;

/**
 * Creates the registry and lifecycle service owned by registered metadata.
 */
final class RegisteredMetaModule {
	public const MODULE_ID = 'scheduled-changes-custom-meta';

	/** Creates the allowlisted registered-meta registry. */
	public function createRegistry(): WordPressMetaFieldRegistry {
		return new WordPressMetaFieldRegistry();
	}

	/** Creates registered-meta lifecycle behavior over one registry. */
	public function createService( ?WordPressMetaFieldRegistry $registry = null ): RegisteredMetaService {
		return new RegisteredMetaService( $registry ?? $this->createRegistry() );
	}
}
