/** * @throws DatabaseException */ private function connect() { try { $this->pdo = new PDO($this->portfolio->getSetting('database.dsn', 'mysql:host=localhost;dbname=database'), $this->portfolio->getSetting('database.user', 'root'), $this->portfolio->getSetting('database.password', '')); } catch (\PDOException $e) { throw new DatabaseException($e->getMessage()); } }