# remove-schema/trunk/src/class-plugin.php

Remove Schema, version trunk. 84 lines.

- Page: https://pluginprobe.com/plugins/remove-schema/trunk/code/src/class-plugin.php
- Raw: https://pluginprobe.com/plugins/remove-schema/trunk/raw/src/class-plugin.php
- Modified: 2026-05-11T18:40:48+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/remove-schema/trunk/code/src/class-plugin.php#L10-L20`.

```php
<?php
/**
 * Main plugin runtime.
 *
 * @package TimVanIersel\RemoveSchema
 */

declare(strict_types=1);

namespace TimVanIersel\RemoveSchema;

use TimVanIersel\RemoveSchema\Admin\AdminAssets;
use TimVanIersel\RemoveSchema\Admin\PostEditor;
use TimVanIersel\RemoveSchema\Admin\SettingsPage;
use TimVanIersel\RemoveSchema\Contracts\Service;
use TimVanIersel\RemoveSchema\Infrastructure\AssetLocator;
use TimVanIersel\RemoveSchema\PublicSite\SchemaRemoval;
use TimVanIersel\RemoveSchema\Schema\MarkupCleaner;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Main plugin class responsible for bootstrapping all services.
 */
final class Plugin {
	/**
	 * Plugin context value object.
	 *
	 * @var PluginContext
	 */
	private PluginContext $context;

	/**
	 * Asset locator instance.
	 *
	 * @var AssetLocator
	 */
	private AssetLocator $assets;

	/**
	 * Constructor.
	 */
	private function __construct() {
		$this->context = new PluginContext(
			REMOVE_SCHEMA_FILE,
			REMOVE_SCHEMA_PATH,
			REMOVE_SCHEMA_URL,
			REMOVE_SCHEMA_VERSION,
			'remove-schema',
			'remove-schema'
		);
		$this->assets  = new AssetLocator( $this->context );
	}

	/**
	 * Bootstrap the plugin.
	 *
	 * @return void
	 */
	public static function boot(): void {
		$plugin = new self();

		foreach ( $plugin->services() as $service ) {
			$service->register();
		}
	}

	/**
	 * Build the service list explicitly.
	 *
	 * @return array<int, Service>
	 */
	private function services(): array {
		return array(
			new SettingsPage( $this->context ),
			new PostEditor( $this->context ),
			new AdminAssets( $this->assets ),
			new SchemaRemoval( $this->context, new MarkupCleaner() ),
		);
	}
}

```
