diff --git a/core/lib/Drupal/Core/Database/Connection.php b/core/lib/Drupal/Core/Database/Connection.php
old mode 100644
new mode 100755
index 33d0337..6eed7f8
--- a/core/lib/Drupal/Core/Database/Connection.php
+++ b/core/lib/Drupal/Core/Database/Connection.php
@@ -1290,7 +1290,7 @@ public function commit() {
   }
 
   /**
-   * Retrieves an unique ID from a given sequence.
+   * Retrieves a unique ID from a given sequence.
    *
    * Use this function if for some reason you can't use a serial field. For
    * example, MySQL has no ways of reading of the current value of a sequence
@@ -1298,13 +1298,13 @@ public function commit() {
    * value. Or sometimes you just need a unique integer.
    *
    * @param $existing_id
-   *   (optional) 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.
+   *   (optional) The maximum existing ID. 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.
    *
    * @return
    *   An integer number larger than any number returned by earlier calls and
-   *   also larger than the $existing_id if one was passed in.
+   *   also larger than $existing_id if one was passed in.
    */
   abstract public function nextId($existing_id = 0);
 
@@ -1326,9 +1326,9 @@ public function commit() {
    *
    * @return \PDOStatement|false
    *   If the database server successfully prepares the statement, returns a
-   *   \PDOStatement object.
-   *   If the database server cannot successfully prepare the statement  returns
-   *   FALSE or emits \PDOException (depending on error handling).
+   *   \PDOStatement object. If the database server cannot successfully prepare
+   *   the statement, returns FALSE or emits \PDOException (depending on error
+   *   handling).
    *
    * @throws \PDOException
    *
diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php b/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php
old mode 100644
new mode 100755
index 4bc3c29..e0614b1
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php
@@ -46,7 +46,7 @@ class Connection extends DatabaseConnection {
   const MIN_MAX_ALLOWED_PACKET = 1024;
 
   /**
-   * Constructs a Connection object.
+   * {@inheritdoc}
    */
   public function __construct(\PDO $connection, array $connection_options = array()) {
     parent::__construct($connection, $connection_options);
@@ -174,20 +174,32 @@ public function __destruct() {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function queryRange($query, $from, $count, array $args = array(), array $options = array()) {
     return $this->query($query . ' LIMIT ' . (int) $from . ', ' . (int) $count, $args, $options);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function queryTemporary($query, array $args = array(), array $options = array()) {
     $tablename = $this->generateTemporaryTableName();
     $this->query('CREATE TEMPORARY TABLE {' . $tablename . '} Engine=MEMORY ' . $query, $args, $options);
     return $tablename;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function driver() {
     return 'mysql';
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function databaseType() {
     return 'mysql';
   }
@@ -214,11 +226,17 @@ public function createDatabase($database) {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function mapConditionOperator($operator) {
     // We don't want to override any of the defaults.
     return NULL;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function nextId($existing_id = 0) {
     $new_id = $this->query('INSERT INTO {sequences} () VALUES ()', array(), array('return' => Database::RETURN_INSERT_ID));
     // This should only happen after an import or similar event.
@@ -237,6 +255,9 @@ public function nextId($existing_id = 0) {
     return $new_id;
   }
 
+  /**
+   * Cleans up the sequences table to ensure it does not use too much storage.
+   */
   public function nextIdDelete() {
     // While we want to clean up the table to keep it up from occupying too
     // much storage and memory, we must keep the highest value in the table
@@ -263,6 +284,10 @@ public function nextIdDelete() {
 
   /**
    * Overridden to work around issues to MySQL not supporting transactional DDL.
+   *
+   * @throws \Drupal\Core\Database\DatabaseExceptionWrapper
+   * @throws \Exception
+   * @throws \Drupal\Core\Database\TransactionCommitFailedException
    */
   protected function popCommittableTransactions() {
     // Commit all the committable layers.
diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php b/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php
old mode 100644
new mode 100755
index 8c1f51d..53cfed6
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php
@@ -46,9 +46,14 @@ class Schema extends DatabaseSchema {
   );
 
   /**
-   * Get information about the table and database name from the prefix.
+   * Gets information about the table name and database from the prefix.
    *
-   * @return
+   * @param string $table
+   *   Name of table to look prefix up for.
+   * @param bool $add_prefix
+   *   Boolean that indicates whether the given table name should be prefixed.
+   *
+   * @return array
    *   A keyed array with information about the database, table name and prefix.
    */
   protected function getPrefixInfo($table = 'default', $add_prefix = TRUE) {
@@ -147,6 +152,9 @@ protected function createTableSql($name, $table) {
    *   Name of the field.
    * @param array $spec
    *   The field specification, as per the schema data structure format.
+   *
+   * @return string
+   *   The generated SQL string.
    */
   protected function createFieldSql($name, $spec) {
     $sql = "`" . $name . "` " . $spec['mysql_type'];
@@ -230,6 +238,9 @@ protected function processField($field) {
     return $field;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function getFieldTypeMap() {
     // Put :normal last so it gets preserved by array_flip. This makes
     // it much easier for modules (such as schema.module) to map
@@ -273,6 +284,15 @@ public function getFieldTypeMap() {
     return $map;
   }
 
+  /**
+   * Generates key and index SQL from a field specification.
+   *
+   * @param array $spec
+   *   The field specification.
+   *
+   * @return string
+   *   The generated SQL snippet.
+   */
   protected function createKeysSql($spec) {
     $keys = array();
 
@@ -357,6 +377,17 @@ protected function shortenIndex(&$index) {
     }
   }
 
+  /**
+   * Generates SQL from field definitions.
+   *
+   * @param array $fields
+   *   Array of field definitions. Each array value is either:
+   *   - A field name (string).
+   *   - An array containing the field name and field alias.
+   *
+   * @return string
+   *   The generated SQL snippet.
+   */
   protected function createKeySql($fields) {
     $return = array();
     foreach ($fields as $field) {
@@ -370,6 +401,9 @@ protected function createKeySql($fields) {
     return implode(', ', $return);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function renameTable($table, $new_name) {
     if (!$this->tableExists($table)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot rename @table to @table_new: table @table doesn't exist.", array('@table' => $table, '@table_new' => $new_name)));
@@ -382,6 +416,9 @@ public function renameTable($table, $new_name) {
     return $this->connection->query('ALTER TABLE {' . $table . '} RENAME TO `' . $info['table'] . '`');
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function dropTable($table) {
     if (!$this->tableExists($table)) {
       return FALSE;
@@ -391,6 +428,9 @@ public function dropTable($table) {
     return TRUE;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function addField($table, $field, $spec, $keys_new = array()) {
     if (!$this->tableExists($table)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot add field @table.@field: table doesn't exist.", array('@field' => $field, '@table' => $table)));
@@ -421,6 +461,9 @@ public function addField($table, $field, $spec, $keys_new = array()) {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function dropField($table, $field) {
     if (!$this->fieldExists($table, $field)) {
       return FALSE;
@@ -430,6 +473,9 @@ public function dropField($table, $field) {
     return TRUE;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function fieldSetDefault($table, $field, $default) {
     if (!$this->fieldExists($table, $field)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot set default value of field @table.@field: field doesn't exist.", array('@table' => $table, '@field' => $field)));
@@ -438,6 +484,9 @@ public function fieldSetDefault($table, $field, $default) {
     $this->connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN `' . $field . '` SET DEFAULT ' . $this->escapeDefaultValue($default));
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function fieldSetNoDefault($table, $field) {
     if (!$this->fieldExists($table, $field)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot remove default value of field @table.@field: field doesn't exist.", array('@table' => $table, '@field' => $field)));
@@ -446,6 +495,9 @@ public function fieldSetNoDefault($table, $field) {
     $this->connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN `' . $field . '` DROP DEFAULT');
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function indexExists($table, $name) {
     // Returns one row for each column in the index. Result is string or FALSE.
     // Details at http://dev.mysql.com/doc/refman/5.0/en/show-index.html
@@ -453,6 +505,9 @@ public function indexExists($table, $name) {
     return isset($row['Key_name']);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function addPrimaryKey($table, $fields) {
     if (!$this->tableExists($table)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot add primary key to table @table: table doesn't exist.", array('@table' => $table)));
@@ -464,6 +519,9 @@ public function addPrimaryKey($table, $fields) {
     $this->connection->query('ALTER TABLE {' . $table . '} ADD PRIMARY KEY (' . $this->createKeySql($fields) . ')');
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function dropPrimaryKey($table) {
     if (!$this->indexExists($table, 'PRIMARY')) {
       return FALSE;
@@ -473,6 +531,9 @@ public function dropPrimaryKey($table) {
     return TRUE;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function addUniqueKey($table, $name, $fields) {
     if (!$this->tableExists($table)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot add unique key @name to table @table: table doesn't exist.", array('@table' => $table, '@name' => $name)));
@@ -484,6 +545,9 @@ public function addUniqueKey($table, $name, $fields) {
     $this->connection->query('ALTER TABLE {' . $table . '} ADD UNIQUE KEY `' . $name . '` (' . $this->createKeySql($fields) . ')');
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function dropUniqueKey($table, $name) {
     if (!$this->indexExists($table, $name)) {
       return FALSE;
@@ -519,6 +583,9 @@ public function dropIndex($table, $name) {
     return TRUE;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function changeField($table, $field, $field_new, $spec, $keys_new = array()) {
     if (!$this->fieldExists($table, $field)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot change the definition of field @table.@name: field doesn't exist.", array('@table' => $table, '@name' => $field)));
@@ -534,6 +601,9 @@ public function changeField($table, $field, $field_new, $spec, $keys_new = array
     $this->connection->query($sql);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function prepareComment($comment, $length = NULL) {
     // Truncate comment to maximum comment length.
     if (isset($length)) {
@@ -546,6 +616,14 @@ public function prepareComment($comment, $length = NULL) {
 
   /**
    * Retrieve a table or column comment.
+   *
+   * @param $table
+   *   The database table to return comments for.
+   * @param $column
+   *   (optional) A column in $table to return comments for.
+   *
+   * @return string
+   *   A table or column comment.
    */
   public function getComment($table, $column = NULL) {
     $condition = $this->buildTableNameCondition($table);
@@ -562,6 +640,9 @@ public function getComment($table, $column = NULL) {
     return preg_replace('/; InnoDB free:.*$/', '', $comment);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function tableExists($table) {
     // The information_schema table is very slow to query under MySQL 5.0.
     // Instead, we try to select from the table in question.  If it fails,
@@ -579,6 +660,9 @@ public function tableExists($table) {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function fieldExists($table, $column) {
     // The information_schema table is very slow to query under MySQL 5.0.
     // Instead, we try to select from the table and field in question. If it
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php
index ac0184b..9ecc1f0 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 used to obtain a lock to retrieve the next insert ID.
    */
   const POSTGRESQL_NEXTID_LOCK = 1000;
 
@@ -53,7 +53,7 @@ class Connection extends DatabaseConnection {
   'window', 'with'];
 
   /**
-   * Constructs a connection object.
+   * {@inheritdoc}
    */
   public function __construct(\PDO $connection, array $connection_options) {
     parent::__construct($connection, $connection_options);
@@ -141,6 +141,9 @@ public function query($query, array $args = array(), $options = array()) {
     return parent::query($query, $args, $options);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function prepareQuery($query) {
     // mapConditionOperator converts LIKE operations to ILIKE for consistency
     // with MySQL. However, Postgres does not support ILIKE on bytea (blobs)
@@ -152,10 +155,16 @@ public function prepareQuery($query) {
     return parent::prepareQuery(preg_replace('/ ([^ ]+) +(I*LIKE|NOT +I*LIKE) /i', ' ${1}::text ${2} ', $query));
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function queryRange($query, $from, $count, array $args = array(), array $options = array()) {
     return $this->query($query . ' LIMIT ' . (int) $count . ' OFFSET ' . (int) $from, $args, $options);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function queryTemporary($query, array $args = array(), array $options = array()) {
     $tablename = $this->generateTemporaryTableName();
     $this->query('CREATE TEMPORARY TABLE {' . $tablename . '} AS ' . $query, $args, $options);
@@ -232,10 +241,16 @@ public function escapeTable($table) {
     return $escaped;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function driver() {
     return 'pgsql';
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function databaseType() {
     return 'pgsql';
   }
@@ -270,6 +285,9 @@ public function createDatabase($database) {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function mapConditionOperator($operator) {
     static $specials = array(
       // In PostgreSQL, 'LIKE' is case-sensitive. For case-insensitive LIKE
@@ -283,10 +301,19 @@ public function mapConditionOperator($operator) {
   }
 
   /**
-   * Retrieve a the next id in a sequence.
+   * Retrieves 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
+   *   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 int
+   *   An integer number larger than any number returned by earlier calls and
+   *   also larger than $existing if one was passed in.
    */
   public function nextId($existing = 0) {
 
@@ -314,10 +341,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
old mode 100644
new mode 100755
index 6025a70..79aedf8
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
@@ -83,9 +83,10 @@ protected function ensureIdentifiersLength($identifier) {
    * We introspect the database to collect the information required by insert
    * and update queries.
    *
-   * @param $table_name
+   * @param string $table
    *   The non-prefixed name of the table.
-   * @return
+   *
+   * @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.
@@ -169,11 +170,12 @@ protected function resetTableInformation($table) {
    * We introspect the database to collect the information required by field
    * alteration.
    *
-   * @param $table
+   * @param string $table
    *   The non-prefixed name of the table.
-   * @param $field
+   * @param string $field
    *   The name of the field.
-   * @return
+   *
+   * @return mixed[]
    *   An array of all the checks for the field.
    */
   public function queryFieldInformation($table, $field) {
@@ -207,11 +209,11 @@ public function queryFieldInformation($table, $field) {
   /**
    * Generate SQL to create a new table from a Drupal schema definition.
    *
-   * @param $name
+   * @param string $name
    *   The name of the table to create.
-   * @param $table
+   * @param array $table
    *   A Schema API table definition array.
-   * @return
+   * @return string[]
    *   An array of SQL statements to create the table.
    */
   protected function createTableSql($name, $table) {
@@ -268,9 +270,12 @@ protected function createTableSql($name, $table) {
    * function it has to be processed by _db_process_field().
    *
    * @param $name
-   *    Name of the field.
+   *   Name of the field.
    * @param $spec
-   *    The field specification, as per the schema data structure format.
+   *   The field specification, as per the schema data structure format.
+   *
+   * @return string
+   *   Generated SQL string.
    */
   protected function createFieldSql($name, $spec) {
     // The PostgreSQL server converts names into lowercase, unless quoted.
@@ -400,6 +405,17 @@ function getFieldTypeMap() {
     return $map;
   }
 
+  /**
+   * Generates SQL from field definitions.
+   *
+   * @param array $fields
+   *   Array of field definitions. Each array value is either:
+   *   - A field name (string).
+   *   - An array containing the field name and field alias.
+   *
+   * @return string
+   *   The generated SQL snippet.
+   */
   protected function _createKeySql($fields) {
     $return = array();
     foreach ($fields as $field) {
@@ -442,6 +458,9 @@ public function tableExists($table) {
     return (bool) $this->connection->query("SELECT 1 FROM pg_tables WHERE schemaname = :schema AND tablename = :table", array(':schema' => $prefixInfo['schema'], ':table' => $prefixInfo['table']))->fetchField();
   }
 
+  /**
+   * {@inheritdoc}
+   */
   function renameTable($table, $new_name) {
     if (!$this->tableExists($table)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot rename @table to @table_new: table @table doesn't exist.", array('@table' => $table, '@table_new' => $new_name)));
@@ -496,6 +515,9 @@ function renameTable($table, $new_name) {
     $this->resetTableInformation($table);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function dropTable($table) {
     if (!$this->tableExists($table)) {
       return FALSE;
@@ -506,6 +528,9 @@ public function dropTable($table) {
     return TRUE;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function addField($table, $field, $spec, $new_keys = array()) {
     if (!$this->tableExists($table)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot add field @table.@field: table doesn't exist.", array('@field' => $field, '@table' => $table)));
@@ -540,6 +565,9 @@ public function addField($table, $field, $spec, $new_keys = array()) {
     $this->resetTableInformation($table);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function dropField($table, $field) {
     if (!$this->fieldExists($table, $field)) {
       return FALSE;
@@ -550,6 +578,9 @@ public function dropField($table, $field) {
     return TRUE;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function fieldSetDefault($table, $field, $default) {
     if (!$this->fieldExists($table, $field)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot set default value of field @table.@field: field doesn't exist.", array('@table' => $table, '@field' => $field)));
@@ -560,6 +591,9 @@ public function fieldSetDefault($table, $field, $default) {
     $this->connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN "' . $field . '" SET DEFAULT ' . $default);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function fieldSetNoDefault($table, $field) {
     if (!$this->fieldExists($table, $field)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot remove default value of field @table.@field: field doesn't exist.", array('@table' => $table, '@field' => $field)));
@@ -568,6 +602,9 @@ public function fieldSetNoDefault($table, $field) {
     $this->connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN "' . $field . '" DROP DEFAULT');
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function indexExists($table, $name) {
     // Details http://www.postgresql.org/docs/9.1/interactive/view-pg-indexes.html
     $index_name = $this->ensureIdentifiersLength($table, $name, 'idx');
@@ -584,6 +621,9 @@ public function indexExists($table, $name) {
    *   The name of the table.
    * @param $name
    *   The name of the constraint (typically 'pkey' or '[constraint]_key').
+   *
+   * @return bool
+   *   TRUE, if the constraint exists.
    */
   public function constraintExists($table, $name) {
     $constraint_name = $this->ensureIdentifiersLength($table, $name);
@@ -593,6 +633,9 @@ public function constraintExists($table, $name) {
     return (bool) $this->connection->query("SELECT 1 FROM pg_constraint WHERE conname = '$constraint_name'")->fetchField();
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function addPrimaryKey($table, $fields) {
     if (!$this->tableExists($table)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot add primary key to table @table: table doesn't exist.", array('@table' => $table)));
@@ -605,6 +648,9 @@ public function addPrimaryKey($table, $fields) {
     $this->resetTableInformation($table);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function dropPrimaryKey($table) {
     if (!$this->constraintExists($table, 'pkey')) {
       return FALSE;
@@ -615,6 +661,9 @@ public function dropPrimaryKey($table) {
     return TRUE;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   function addUniqueKey($table, $name, $fields) {
     if (!$this->tableExists($table)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot add unique key @name to table @table: table doesn't exist.", array('@table' => $table, '@name' => $name)));
@@ -627,6 +676,9 @@ function addUniqueKey($table, $name, $fields) {
     $this->resetTableInformation($table);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function dropUniqueKey($table, $name) {
     if (!$this->constraintExists($table, $name . '__key')) {
       return FALSE;
@@ -652,6 +704,9 @@ public function addIndex($table, $name, $fields, array $spec) {
     $this->resetTableInformation($table);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function dropIndex($table, $name) {
     if (!$this->indexExists($table, $name)) {
       return FALSE;
@@ -662,6 +717,9 @@ public function dropIndex($table, $name) {
     return TRUE;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function changeField($table, $field, $field_new, $spec, $new_keys = array()) {
     if (!$this->fieldExists($table, $field)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot change the definition of field @table.@name: field doesn't exist.", array('@table' => $table, '@name' => $field)));
@@ -765,12 +823,35 @@ public function changeField($table, $field, $field_new, $spec, $new_keys = array
     $this->resetTableInformation($table);
   }
 
+  /**
+   * Generates index SQL from field definitions.
+   *
+   * @param string $table
+   *   The table on which the index will be created.
+   * @param string $name
+   *   An identifying name for this index.
+   * @param array $fields
+   *   Array of field definitions. Each array value is either:
+   *   - A field name (string).
+   *   - An array containing the field name and field alias.
+   *
+   * @return string
+   *   The generated SQL snippet.
+   */
   protected function _createIndexSql($table, $name, $fields) {
     $query = 'CREATE INDEX ' . $this->ensureIdentifiersLength($table, $name, 'idx') . ' ON {' . $table . '} (';
     $query .= $this->_createKeySql($fields) . ')';
     return $query;
   }
 
+  /**
+   * Helper function: adds keys and indexes to a table.
+   *
+   * @param string $table
+   *   The table on which the keys and indexes will be added.
+   * @param array $new_keys
+   *   The field specification.
+   */
   protected function _createKeys($table, $new_keys) {
     if (isset($new_keys['primary key'])) {
       $this->addPrimaryKey($table, $new_keys['primary key']);
@@ -792,6 +873,14 @@ protected function _createKeys($table, $new_keys) {
 
   /**
    * Retrieve a table or column comment.
+   *
+   * @param $table
+   *   The database table to return comments for.
+   * @param $column
+   *   (optional) A column in $table to return comments for.
+   *
+   * @return string
+   *   A table or column comment.
    */
   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 c0f6c10..16beaeb 100644
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php
@@ -13,6 +13,8 @@
 
 /**
  * Specific SQLite implementation of DatabaseConnection.
+ *
+ * @ingroup database
  */
 class Connection extends DatabaseConnection {
 
@@ -49,7 +51,7 @@ class Connection extends DatabaseConnection {
   var $tableDropped = FALSE;
 
   /**
-   * Constructs a \Drupal\Core\Database\Driver\sqlite\Connection object.
+   * {@inheritdoc}
    */
   public function __construct(\PDO $connection, array $connection_options) {
     // We don't need a specific PDOStatement class here, we simulate it in
@@ -170,6 +172,16 @@ public function __destruct() {
 
   /**
    * SQLite compatibility implementation for the IF() SQL function.
+   *
+   * @param bool $condition
+   *   A condition that will determine what expression is returned.
+   * @param mixed $expr1
+   *   Value if $condition is TRUE.
+   * @param mixed $expr2
+   *   (optional) Value if $condition is FALSE.
+   *
+   * @return string
+   *   It returns $expr1 if $condition is TRUE, and $expr2 if not.
    */
   public static function sqlFunctionIf($condition, $expr1, $expr2 = NULL) {
     return $condition ? $expr1 : $expr2;
@@ -177,6 +189,12 @@ public static function sqlFunctionIf($condition, $expr1, $expr2 = NULL) {
 
   /**
    * SQLite compatibility implementation for the GREATEST() SQL function.
+   *
+   * @param ...
+   *   Variable parameters.
+   *
+   * @return mixed|null
+   *   The maximum of the given arguments.
    */
   public static function sqlFunctionGreatest() {
     $args = func_get_args();
@@ -195,6 +213,12 @@ public static function sqlFunctionGreatest() {
 
   /**
    * SQLite compatibility implementation for the CONCAT() SQL function.
+   *
+   * @param ...
+   *   Variable parameters.
+   *
+   * @return string
+   *   Concatenated input arguments.
    */
   public static function sqlFunctionConcat() {
     $args = func_get_args();
@@ -222,6 +246,16 @@ public static function sqlFunctionConcatWs() {
 
   /**
    * SQLite compatibility implementation for the SUBSTRING() SQL function.
+   *
+   * @param string $string
+   *   The string that will be the subject of the the substring evaluation.
+   * @param int $from
+   *   The starting position of the substring.
+   * @param int $length
+   *   The length of the substring.
+   *
+   * @return string
+   *   A substring of the provided string.
    */
   public static function sqlFunctionSubstring($string, $from, $length) {
     return substr($string, $from - 1, $length);
@@ -229,6 +263,17 @@ public static function sqlFunctionSubstring($string, $from, $length) {
 
   /**
    * SQLite compatibility implementation for the SUBSTRING_INDEX() SQL function.
+   *
+   * @param string $string
+   *   The subject for the substring.
+   * @param string $delimiter
+   *   The delimiter character to look for.
+   * @param int $count
+   *   The number of occurrences to look for.
+   *
+   * @return string
+   *   The substring of the provided string, before the number of occurrences
+   *   of the delimiter.
    */
   public static function sqlFunctionSubstringIndex($string, $delimiter, $count) {
     // If string is empty, simply return an empty string.
@@ -312,10 +357,16 @@ protected function handleQueryException(\PDOException $e, $query, array $args =
     parent::handleQueryException($e, $query, $args, $options);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function queryRange($query, $from, $count, array $args = array(), array $options = array()) {
     return $this->query($query . ' LIMIT ' . (int) $from . ', ' . (int) $count, $args, $options);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function queryTemporary($query, array $args = array(), array $options = array()) {
     // Generate a new temporary table name and protect it from prefixing.
     // SQLite requires that temporary tables to be non-qualified.
@@ -328,10 +379,16 @@ public function queryTemporary($query, array $args = array(), array $options = a
     return $tablename;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function driver() {
     return 'sqlite';
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function databaseType() {
     return 'sqlite';
   }
@@ -352,6 +409,9 @@ public function createDatabase($database) {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function mapConditionOperator($operator) {
     // We don't want to override any of the defaults.
     static $specials = array(
@@ -370,6 +430,9 @@ public function prepareQuery($query) {
     return $this->prepare($this->prefixTables($query));
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function nextId($existing_id = 0) {
     $this->startTransaction();
     // We can safely use literal queries here instead of the slower query
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php
old mode 100644
new mode 100755
index f417b18..5112036
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php
@@ -24,6 +24,9 @@ class Schema extends DatabaseSchema {
    */
   protected $defaultSchema = 'main';
 
+  /**
+   * {@inheritdoc}
+   */
   public function tableExists($table) {
     $info = $this->getPrefixInfo($table);
 
@@ -31,6 +34,9 @@ public function tableExists($table) {
     return (bool) $this->connection->query('SELECT 1 FROM ' . $info['schema'] . '.sqlite_master WHERE type = :type AND name = :name', array(':type' => 'table', ':name' => $info['table']))->fetchField();
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function fieldExists($table, $column) {
     $schema = $this->introspectSchema($table);
     return !empty($schema['fields'][$column]);
@@ -39,11 +45,12 @@ public function fieldExists($table, $column) {
   /**
    * Generate SQL to create a new table from a Drupal schema definition.
    *
-   * @param $name
+   * @param string $name
    *   The name of the table to create.
-   * @param $table
+   * @param array $table
    *   A Schema API table definition array.
-   * @return
+   *
+   * @return array
    *   An array of SQL statements to create the table.
    */
   public function createTableSql($name, $table) {
@@ -54,6 +61,14 @@ public function createTableSql($name, $table) {
 
   /**
    * Build the SQL expression for indexes.
+   *
+   * @param string $tablename
+   *   The name of the table to create indexes on.
+   * @param array $schema
+   *   A Schema API table definition array.
+   *
+   * @return string[]
+   *   Array of SQL statements to create the indexes.
    */
   protected function createIndexSql($tablename, $schema) {
     $sql = array();
@@ -73,6 +88,14 @@ protected function createIndexSql($tablename, $schema) {
 
   /**
    * Build the SQL expression for creating columns.
+   *
+   * @param string $tablename
+   *   The name of the table to create columns on.
+   * @param array $schema
+   *   A Schema API table definition array.
+   *
+   * @return string
+   *   Generated SQL snippet.
    */
   protected function createColumnsSql($tablename, $schema) {
     $sql_array = array();
@@ -151,9 +174,12 @@ protected function processField($field) {
    * to be processed by db_processField().
    *
    * @param $name
-   *    Name of the field.
+   *   Name of the field.
    * @param $spec
-   *    The field specification, as per the schema data structure format.
+   *   The field specification, as per the schema data structure format.
+   *
+   * @return string
+   *   Generated SQL string.
    */
   protected function createFieldSql($name, $spec) {
     if (!empty($spec['auto_increment'])) {
@@ -203,8 +229,7 @@ protected function createFieldSql($name, $spec) {
   }
 
   /**
-   * This maps a generic data type in combination with its data size
-   * to the engine-specific data type.
+   * {@inheritdoc}
    */
   public function getFieldTypeMap() {
     // Put :normal last so it gets preserved by array_flip. This makes
@@ -249,6 +274,9 @@ public function getFieldTypeMap() {
     return $map;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function renameTable($table, $new_name) {
     if (!$this->tableExists($table)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot rename @table to @table_new: table @table doesn't exist.", array('@table' => $table, '@table_new' => $new_name)));
@@ -286,6 +314,9 @@ public function renameTable($table, $new_name) {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function dropTable($table) {
     if (!$this->tableExists($table)) {
       return FALSE;
@@ -295,6 +326,9 @@ public function dropTable($table) {
     return TRUE;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function addField($table, $field, $specification, $keys_new = array()) {
     if (!$this->tableExists($table)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot add field @table.@field: table doesn't exist.", array('@field' => $field, '@table' => $table)));
@@ -355,13 +389,13 @@ public function addField($table, $field, $specification, $keys_new = array()) {
    * As SQLite does not support ALTER TABLE (with a few exceptions) it is
    * necessary to create a new table and copy over the old content.
    *
-   * @param $table
+   * @param string $table
    *   Name of the table to be altered.
-   * @param $old_schema
+   * @param array $old_schema
    *   The old schema array for the table.
-   * @param $new_schema
+   * @param array $new_schema
    *   The new schema array for the table.
-   * @param $mapping
+   * @param array $mapping
    *   An optional mapping between the fields of the old specification and the
    *   fields of the new specification. An associative array, whose keys are
    *   the fields of the new table, and values can take two possible forms:
@@ -420,10 +454,13 @@ protected function alterTable($table, $old_schema, $new_schema, array $mapping =
    * create a schema array. This is useful, for example, during update when
    * the old schema is not available.
    *
-   * @param $table
+   * @param string $table
    *   Name of the table.
-   * @return
+   *
+   * @return array
    *   An array representing the schema, from drupal_get_schema().
+   *
+   * @see drupal_get_schema()
    */
   protected function introspectSchema($table) {
     $mapped_fields = array_flip($this->getFieldTypeMap());
@@ -486,6 +523,9 @@ protected function introspectSchema($table) {
     return $schema;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function dropField($table, $field) {
     if (!$this->fieldExists($table, $field)) {
       return FALSE;
@@ -517,6 +557,9 @@ public function dropField($table, $field) {
     return TRUE;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function changeField($table, $field, $field_new, $spec, $keys_new = array()) {
     if (!$this->fieldExists($table, $field)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot change the definition of field @table.@name: field doesn't exist.", array('@table' => $table, '@name' => $field)));
@@ -568,6 +611,9 @@ public function changeField($table, $field, $field_new, $spec, $keys_new = array
    *   The key definition.
    * @param $mapping
    *   The new mapping.
+   *
+   * @return array
+   *   The modified key definition.
    */
   protected function mapKeyDefinition(array $key_definition, array $mapping) {
     foreach ($key_definition as &$field) {
@@ -600,12 +646,18 @@ public function addIndex($table, $name, $fields, array $spec) {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function indexExists($table, $name) {
     $info = $this->getPrefixInfo($table);
 
     return $this->connection->query('PRAGMA ' . $info['schema'] . '.index_info(' . $info['table'] . '_' . $name . ')')->fetchField() != '';
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function dropIndex($table, $name) {
     if (!$this->indexExists($table, $name)) {
       return FALSE;
@@ -617,6 +669,9 @@ public function dropIndex($table, $name) {
     return TRUE;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function addUniqueKey($table, $name, $fields) {
     if (!$this->tableExists($table)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot add unique key @name to table @table: table doesn't exist.", array('@table' => $table, '@name' => $name)));
@@ -632,6 +687,9 @@ public function addUniqueKey($table, $name, $fields) {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function dropUniqueKey($table, $name) {
     if (!$this->indexExists($table, $name)) {
       return FALSE;
@@ -643,6 +701,9 @@ public function dropUniqueKey($table, $name) {
     return TRUE;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function addPrimaryKey($table, $fields) {
     if (!$this->tableExists($table)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot add primary key to table @table: table doesn't exist.", array('@table' => $table)));
@@ -659,6 +720,9 @@ public function addPrimaryKey($table, $fields) {
     $this->alterTable($table, $old_schema, $new_schema);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function dropPrimaryKey($table) {
     $old_schema = $this->introspectSchema($table);
     $new_schema = $old_schema;
@@ -672,6 +736,9 @@ public function dropPrimaryKey($table) {
     return TRUE;
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function fieldSetDefault($table, $field, $default) {
     if (!$this->fieldExists($table, $field)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot set default value of field @table.@field: field doesn't exist.", array('@table' => $table, '@field' => $field)));
@@ -684,6 +751,9 @@ public function fieldSetDefault($table, $field, $default) {
     $this->alterTable($table, $old_schema, $new_schema);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function fieldSetNoDefault($table, $field) {
     if (!$this->fieldExists($table, $field)) {
       throw new SchemaObjectDoesNotExistException(t("Cannot remove default value of field @table.@field: field doesn't exist.", array('@table' => $table, '@field' => $field)));
@@ -696,6 +766,9 @@ public function fieldSetNoDefault($table, $field) {
     $this->alterTable($table, $old_schema, $new_schema);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function findTables($table_expression) {
     // Don't add the prefix, $table_expression already includes the prefix.
     $info = $this->getPrefixInfo($table_expression, FALSE);
