Add default case/exception for database type

This commit is contained in:
Dennis Eichhorn 2018-01-16 18:53:49 +01:00
parent bdf7b705cc
commit 24c6194f5c
3 changed files with 9 additions and 0 deletions

View File

@ -16,6 +16,7 @@ namespace phpOMS\Module;
use phpOMS\DataStorage\Database\DatabaseType;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\DataStorage\Database\Exception\InvalidDatabaseTypeException;
/**
* Installer Abstract class.
@ -86,6 +87,8 @@ class ActivateAbstract
$dbPool->get()->con->commit();
break;
default:
throw new InvalidDatabaseTypeException($dbPool->get()->getType());
}
}
}

View File

@ -16,6 +16,7 @@ namespace phpOMS\Module;
use phpOMS\DataStorage\Database\DatabaseType;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\DataStorage\Database\Exception\InvalidDatabaseTypeException;
/**
* Installer Abstract class.
@ -86,6 +87,8 @@ class DeactivateAbstract
$dbPool->get()->con->commit();
break;
default:
throw new InvalidDatabaseTypeException($dbPool->get()->getType());
}
}
}

View File

@ -15,6 +15,7 @@ declare(strict_types = 1);
namespace phpOMS\Module;
use phpOMS\DataStorage\Database\DatabaseType;
use phpOMS\DataStorage\Database\Exception\InvalidDatabaseTypeException;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\System\File\Local\Directory;
use phpOMS\System\File\PathException;
@ -79,6 +80,8 @@ class InstallerAbstract
$dbPool->get()->con->commit();
break;
default:
throw new InvalidDatabaseTypeException($dbPool->get()->getType());
}
}