get_settings() ->is_initializated() ); $init_database = !( $this ->get_versions() ->is_installed() ); if ($init_settings or $init_database) { $this ->install(); } $this ->get_installer() ->update(); } public function install() : void { $this ->remove(); $this ->get_settings() ->init(); $this ->get_installer() ->init() ->update(); } public function remove() : void { $this ->get_settings() ->clean(); $this ->get_installer() ->clean(); } private function get_installer() : database_installer { if ($this->installer !== null) { return $this->installer; } $this->installer = new database_installer( $this->get_database(), $this->get_tables(), $this->get_versions() ); return $this->get_installer(); } private ?database_installer $installer = null; }