Permalink
Browse files

Simplified checks.

Changed input parameter comment to generic object.
  • Loading branch information...
1 parent f37c04e commit a24d16d3f9c06493f6f75f6a6a442ad7b0d8eb42 @gpongelli committed Jul 21, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 libraries/joomla/database/driver.php
View
10 libraries/joomla/database/driver.php
@@ -421,9 +421,9 @@ public function alterDbCharacterSet($dbName)
* Create a new database using information from $options object, obtaining query string
* from protected member.
*
- * @param JObject $options JObject coming from CMS' "initialise" function to pass user
- * and database name to database driver.
- * @param boolean $utf True if the database supports the UTF-8 character set.
+ * @param stdClass $options Object used to pass user and database name to database driver.
+ * This object must have "db_name" and "db_user" set.
+ * @param boolean $utf True if the database supports the UTF-8 character set.
*
* @return string The query that creates database
*
@@ -436,11 +436,11 @@ public function createDatabase($options, $utf = true)
{
throw new RuntimeException('$options object must not be null.');
}
- elseif (!isset($options->db_name) || empty($options->db_name))
+ elseif (empty($options->db_name))
{
throw new RuntimeException('$options object must have db_name set.');
}
- elseif (!isset($options->db_user) || empty($options->db_user))
+ elseif (empty($options->db_user))
{
throw new RuntimeException('$options object must have db_user set.');
}

0 comments on commit a24d16d

Please sign in to comment.