Closed damianopetrungaro closed 5 years ago
You may consider this usage.
class DB extends Medoo
{
public function __construct(
string $type,
string $name,
string $server,
string $username,
string $password,
string $prefix,
$charset = "utf8"
) {
try {
parent::__construct([
'database_type' => $type,
'database_name' => $name,
'server' => $server,
'username' => $username,
'password' => $password,
'prefix' => $prefix,
'charset' => $charset,
]);
} catch (\Exception $e) {
throw \PerSeo\DB\Exception\InvalidArgumentException::fromPrevious($e);
}
}
}
Class changed, using direct Medoo Exception.
Here is an example: Class DB.
Why are you using this approach?