diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php index 7e1c358..e059c1d 100644 --- a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php @@ -22,7 +22,7 @@ class Connection extends DatabaseConnection { /** - * The name by which to obtain a lock for retrieve the next insert id. + * The name by which to obtain a lock for retrieve the next insert ID. */ const POSTGRESQL_NEXTID_LOCK = 1000; @@ -240,19 +240,19 @@ public function mapConditionOperator($operator) { } /** - * Retrieve the next id in a sequence. + * Retrieve the next ID in a sequence. * * PostgreSQL has built in sequences. We'll use these instead of inserting * and updating a sequences table. * * @param $existing - * After a database import, it might be that the sequences table is behind, - * so by passing in the maximum existing id, it can be assured that we - * never issue the same id. + * The maximum existing ID makes sure that we never issue the same ID, even + * after a database import when it might be that the sequences table is + * behind. * * @return * An integer number larger than any number returned by earlier calls and - * also larger than the $existing if one was passed in. + * also larger than $existing if one was passed in. */ public function nextId($existing = 0) { @@ -280,10 +280,10 @@ public function nextId($existing = 0) { return $id; } - // Reset the sequence to a higher value than the existing id. + // Reset the sequence to a higher value than the existing ID. $this->query("ALTER SEQUENCE " . $sequence_name . " RESTART WITH " . ($existing + 1)); - // Retrieve the next id. We know this will be as high as we want it. + // Retrieve the next ID. We know this will be as high as we want it. $id = $this->query("SELECT nextval('" . $sequence_name . "')")->fetchField(); $this->query("SELECT pg_advisory_unlock(" . self::POSTGRESQL_NEXTID_LOCK . ")"); diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php index 83a94de..4bb4c54 100644 --- a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php @@ -87,7 +87,7 @@ protected function ensureIdentifiersLength($identifier) { * @param string $table * The non-prefixed name of the table. * - * @return \stdClass + * @return object * An object with two member variables: * - 'blob_fields' that lists all the blob fields in the table. * - 'sequences' that lists the sequences used in that table. @@ -379,13 +379,15 @@ function getFieldTypeMap() { } /** + * Generates SQL from field definitions. + * * @param array $fields - * Array of field definitions. Each array value is either - * - a field name (string), or + * Array of field definitions. Each array value is either: + * - a field name (string), * - an array of two strings, array($field_name, $alias). * * @return string - * The Generated SQL snippet. + * The generated SQL snippet. */ protected function _createKeySql($fields) { $return = array(); @@ -454,7 +456,9 @@ public function copyTable($source, $destination) { // table_name + constraint name convention anymore. throw new \Exception('Not implemented, see https://drupal.org/node/2061879'); } - + /** + * {@inheritdoc} + */ public function dropTable($table) { if (!$this->tableExists($table)) { return FALSE; @@ -719,7 +723,7 @@ public function changeField($table, $field, $field_new, $spec, $new_keys = array * - an array of two strings, array($field_name, $alias). * * @return string - * The Generated SQL snippet. + * The generated SQL snippet. */ protected function _createIndexSql($table, $name, $fields) { $query = 'CREATE INDEX "' . $this->ensureIdentifiersLength($table, $name, 'idx') . '" ON {' . $table . '} ('; @@ -745,10 +749,11 @@ protected function _createKeys($table, $new_keys) { /** * Retrieve a table or column comment. + * * @param $table - * The database table whose comments to return. + * The database table to return comments for. * @param $column - * (optional) A column in $table whose comments to return. + * (optional) A column in $table to return comments for. */ public function getComment($table, $column = NULL) { $info = $this->getPrefixInfo($table); diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php index b970dcf..fbe6ce7 100644 --- a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php +++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php @@ -16,8 +16,9 @@ use Drupal\Core\Database\Connection as DatabaseConnection; /** - * Specific SQLite implementation of DatabaseConnection. - */ + * SQLite implementation of DatabaseConnection::prepare(). SQLite implementation of + * \Drupal\Core\Database\Connection::prepare(). + */ class Connection extends DatabaseConnection { /** @@ -172,11 +173,11 @@ public function __destruct() { * @param bool $condition * A condition that will determine what expression is returned. * @param mixed $expr1 - * Returned if $condition is results to TRUE. + * Value if $condition is TRUE. * @param mixed $expr2 * (optional) Returned if $condition results to FALSE. * - * @return null + * @return */ public static function sqlFunctionIf($condition, $expr1, $expr2 = NULL) { return $condition ? $expr1 : $expr2; @@ -186,9 +187,9 @@ public static function sqlFunctionIf($condition, $expr1, $expr2 = NULL) { * SQLite compatibility implementation for the GREATEST() SQL function. * * @param ... - * Variadic parameters. + * Variable parameters. * - * @return mixed|NULL + * @return mixed|null * The maximum of the given arguments. */ public static function sqlFunctionGreatest() { @@ -202,7 +203,7 @@ public static function sqlFunctionGreatest() { return max($args); } else { - return NULL; + return null; } } @@ -210,7 +211,7 @@ public static function sqlFunctionGreatest() { * SQLite compatibility implementation for the CONCAT() SQL function. * * @param ... - * Variadic parameters. + * Variable parameters. * * @return string * Concatenated input arguments. @@ -242,12 +243,13 @@ public static function sqlFunctionSubstring($string, $from, $length) { * @param string $string * The subject for the substring. * @param string $delimiter - * A value to use start point for the returned substring occurring after - * $count. + * A start point for the returned substring occurring after $count. * @param int $count - * An offset of of $string. + * An offset of $string. * * @return string + * A substring of the provided string. + * */ public static function sqlFunctionSubstringIndex($string, $delimiter, $count) { // If string is empty, simply return an empty string.