/**
* Method to finalise the uninstallation processing
*
* @return boolean
*
* @since 4.0.0
* @throws \RuntimeException
*/
protected function finaliseUninstall() : bool
{
$extensionId = $this->extension->extension_id;
$db = $this->parent->getDbo();
// Remove the schema version
$query = $db->getQuery(true)->delete('#__schemas')->where('extension_id = :extension_id')->bind(':extension_id', $extensionId, ParameterType::INTEGER);
$db->setQuery($query);
$db->execute();
// Now we will no longer need the plugin object, so let's delete it
$this->extension->delete($this->extension->extension_id);
// Remove the plugin's folder
Folder::delete($this->parent->getPath('extension_root'));
return true;
}