<?php

namespace ARCHM;

class Installer {
	/**
	 * Run the installer
	 *
	 * @return void
	 * @author Siam Maruf
	 * @since 1.0
	 */
	// phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
	public function run(): void {
		$this->add_version();
	}

	/**
	 * Add time and version on DB
	 *
	 * @return void
	 * @author Siam Maruf
	 * @since 1.0
	 */
	// phpcs:ignore PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound
	public function add_version(): void {
		$installed = get_option( '_master_archive_installed' );

		if ( ! $installed ) {
			update_option( '_master_archive_installed', time() );
		}

		update_option( '_master_archive_version', ARCHM_PLUGIN_VERSION );
	}
}
