get_database_version_name(), null); if ($version === null) { return null; } $version = intval($version); if ($version === 0) { return null; } return $version; } public function is_installed() : bool { return $this->get_installed() !== null; } public function set_installed(?int $version) : void { if ($version === null) { delete_option($this->get_database_version_name()); return; } if ($version <= 0) { throw new exception('Version must be greaten than 0.'); } update_option($this->get_database_version_name(), strval($version)); } private function get_database_version_name() : string { return 'cx_newsletter_database_version'; } }