diff --git a/core/lib/Drupal/Core/Database/Connection.php b/core/lib/Drupal/Core/Database/Connection.php index 6eed7f8..6716e89 100755 --- a/core/lib/Drupal/Core/Database/Connection.php +++ b/core/lib/Drupal/Core/Database/Connection.php @@ -1297,7 +1297,7 @@ public function commit() { * and PostgreSQL can not advance the sequence to be larger than a given * value. Or sometimes you just need a unique integer. * - * @param $existing_id + * @param int $existing_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. @@ -1327,7 +1327,7 @@ 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 + * the statement, returns FALSE or throws \PDOException (depending on error * handling). * * @throws \PDOException diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php b/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php index 53cfed6..9a23093 100755 --- a/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php +++ b/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php @@ -93,11 +93,13 @@ protected function buildTableNameCondition($table_name, $operator = '=', $add_pr /** * 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 - * A Schema API table definition array. - * @return + * @param array[] $table + * A Schema API table definition array. See @link schemaapi Schema API + * documentation @endlink for more information. + * + * @return string[] * An array of SQL statements to create the table. */ protected function createTableSql($name, $table) { @@ -146,12 +148,13 @@ protected function createTableSql($name, $table) { * Create an SQL string for a field to be used in table creation or alteration. * * Before passing a field out of a schema definition into this function it has - * to be processed by _db_process_field(). + * to be processed by processField() method. * * @param string $name * Name of the field. - * @param array $spec - * The field specification, as per the schema data structure format. + * @param array[] $spec + * The field specification, as per the schema data structure format. For + * more details, see @link schemaapi Schema API documentation. @endlink * * @return string * The generated SQL string. @@ -212,8 +215,12 @@ protected function createFieldSql($name, $spec) { /** * Set database-engine specific properties for a field. * - * @param $field - * A field description array, as specified in the schema documentation. + * @param array $field + * A field description array, as specified in the schema documentation. For + * more details, see @link schemaapi Schema API documentation. @endlink + * + * @return array[] + * The field description array with MySQL specific field specifications. */ protected function processField($field) { @@ -287,8 +294,10 @@ public function getFieldTypeMap() { /** * Generates key and index SQL from a field specification. * - * @param array $spec - * The field specification. + * @param array[] $spec + * The table specification for which to create keys and indexes. For more + * details on the specification, refer to the @link schemaapi Schema API + * documentation. @endlink * * @return string * The generated SQL snippet. @@ -380,7 +389,7 @@ protected function shortenIndex(&$index) { /** * Generates SQL from field definitions. * - * @param array $fields + * @param string[]|array[] $fields * Array of field definitions. Each array value is either: * - A field name (string). * - An array containing the field name and field alias. @@ -617,9 +626,9 @@ public function prepareComment($comment, $length = NULL) { /** * Retrieve a table or column comment. * - * @param $table + * @param string $table * The database table to return comments for. - * @param $column + * @param string $column * (optional) A column in $table to return comments for. * * @return string diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php old mode 100644 new mode 100755 index 9ecc1f0..1e209f7 --- a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php @@ -306,7 +306,7 @@ public function mapConditionOperator($operator) { * PostgreSQL has built in sequences. We'll use these instead of inserting * and updating a sequences table. * - * @param $existing + * @param int $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. diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php index 79aedf8..55523b1 100755 --- a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php @@ -211,8 +211,10 @@ public function queryFieldInformation($table, $field) { * * @param string $name * The name of the table to create. - * @param array $table - * A Schema API table definition array. + * @param array[] $table + * A Schema API table definition array. See @link schemaapi Schema API + * documentation @endlink for more information. + * * @return string[] * An array of SQL statements to create the table. */ @@ -267,12 +269,13 @@ protected function createTableSql($name, $table) { * alteration. * * Before passing a field out of a schema definition into this - * function it has to be processed by _db_process_field(). + * function it has to be processed by processField() method. * - * @param $name + * @param string $name * Name of the field. - * @param $spec - * The field specification, as per the schema data structure format. + * @param array[] $spec + * The field specification, as per the schema data structure format. For + * more details, see @link schemaapi Schema API documentation. @endlink * * @return string * Generated SQL string. @@ -408,7 +411,7 @@ function getFieldTypeMap() { /** * Generates SQL from field definitions. * - * @param array $fields + * @param string[]|array[] $fields * Array of field definitions. Each array value is either: * - A field name (string). * - An array containing the field name and field alias. @@ -830,7 +833,7 @@ public function changeField($table, $field, $field_new, $spec, $new_keys = array * The table on which the index will be created. * @param string $name * An identifying name for this index. - * @param array $fields + * @param string[]|array[] $fields * Array of field definitions. Each array value is either: * - A field name (string). * - An array containing the field name and field alias. @@ -849,8 +852,9 @@ protected function _createIndexSql($table, $name, $fields) { * * @param string $table * The table on which the keys and indexes will be added. - * @param array $new_keys - * The field specification. + * @param array[] $new_keys + * Schema API specification for the new keys. See @link schemaapi Schema API + * documentation @endlink for more information. */ protected function _createKeys($table, $new_keys) { if (isset($new_keys['primary key'])) { @@ -874,9 +878,9 @@ protected function _createKeys($table, $new_keys) { /** * Retrieve a table or column comment. * - * @param $table + * @param string $table * The database table to return comments for. - * @param $column + * @param string $column * (optional) A column in $table to return comments for. * * @return string diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php old mode 100644 new mode 100755 index 16beaeb..c87b06d --- a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php +++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php @@ -193,8 +193,8 @@ public static function sqlFunctionIf($condition, $expr1, $expr2 = NULL) { * @param ... * Variable parameters. * - * @return mixed|null - * The maximum of the given arguments. + * @return mixed + * The maximum of the given arguments. NULL if no arguments specified. */ public static function sqlFunctionGreatest() { $args = func_get_args(); diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php index 5112036..51760d0 100755 --- a/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php +++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php @@ -47,10 +47,11 @@ public function fieldExists($table, $column) { * * @param string $name * The name of the table to create. - * @param array $table - * A Schema API table definition array. + * @param array[] $table + * A Schema API table definition array. See @link schemaapi Schema API + * documentation @endlink for more information. * - * @return array + * @return string[] * An array of SQL statements to create the table. */ public function createTableSql($name, $table) { @@ -64,8 +65,9 @@ public function createTableSql($name, $table) { * * @param string $tablename * The name of the table to create indexes on. - * @param array $schema - * A Schema API table definition array. + * @param array[] $schema + * A Schema API table definition array. See @link schemaapi Schema API + * documentation @endlink for more details. * * @return string[] * Array of SQL statements to create the indexes. @@ -92,7 +94,8 @@ protected function createIndexSql($tablename, $schema) { * @param string $tablename * The name of the table to create columns on. * @param array $schema - * A Schema API table definition array. + * A Schema API table definition array. See @link schemaapi Schema API + * documentation @endlink for more details. * * @return string * Generated SQL snippet. @@ -120,6 +123,14 @@ protected function createColumnsSql($tablename, $schema) { /** * Build the SQL expression for keys. + * + * @param string[]|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(); @@ -173,10 +184,11 @@ protected function processField($field) { * Before passing a field out of a schema definition into this function it has * to be processed by db_processField(). * - * @param $name + * @param string $name * Name of the field. - * @param $spec - * The field specification, as per the schema data structure format. + * @param array[] $spec + * The field specification, as per the schema data structure format. For + * more details, see @link schemaapi Schema API documentation. @endlink * * @return string * Generated SQL string. @@ -391,11 +403,13 @@ public function addField($table, $field, $specification, $keys_new = array()) { * * @param string $table * Name of the table to be altered. - * @param array $old_schema - * The old schema array for the table. - * @param array $new_schema - * The new schema array for the table. - * @param array $mapping + * @param array[] $old_schema + * The old schema array for the table. See @link schemaapi Schema API + * documentation @endlink for more details. + * @param array[] $new_schema + * The new schema array for the table. See @link schemaapi Schema API + * documentation @endlink for more details. + * @param string[]|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: @@ -457,8 +471,9 @@ protected function alterTable($table, $old_schema, $new_schema, array $mapping = * @param string $table * Name of the table. * - * @return array - * An array representing the schema, from drupal_get_schema(). + * @return array[] + * An array representing the schema. See @link schemaapi Schema API + * documentation @endlink for more details. * * @see drupal_get_schema() */ @@ -607,9 +622,9 @@ public function changeField($table, $field, $field_new, $spec, $keys_new = array /** * Utility method: rename columns in an index definition according to a new mapping. * - * @param $key_definition + * @param string[]|array[] $key_definition * The key definition. - * @param $mapping + * @param string[] $mapping * The new mapping. * * @return array diff --git a/core/lib/Drupal/Core/Database/Schema.php b/core/lib/Drupal/Core/Database/Schema.php old mode 100644 new mode 100755 index b9ff670..f46805f --- a/core/lib/Drupal/Core/Database/Schema.php +++ b/core/lib/Drupal/Core/Database/Schema.php @@ -16,6 +16,9 @@ */ abstract class Schema implements PlaceholderInterface { + /** + * @var \Drupal\Core\Database\Connection + */ protected $connection; /** @@ -68,13 +71,13 @@ public function nextPlaceholder() { /** * Get information about the table name and schema from the prefix. * - * @param + * @param string $table * Name of table to look prefix up for. Defaults to 'default' because that's * default key for prefix. - * @param $add_prefix + * @param bool $add_prefix * Boolean that indicates whether the given table name should be prefixed. * - * @return + * @return array * A keyed array with information about the schema, table name and prefix. */ protected function getPrefixInfo($table = 'default', $add_prefix = TRUE) { @@ -155,10 +158,10 @@ protected function buildTableNameCondition($table_name, $operator = '=', $add_pr /** * Check if a table exists. * - * @param $table + * @param string $table * The name of the table in drupal (no prefixing). * - * @return + * @return bool * TRUE if the given table exists, otherwise FALSE. */ public function tableExists($table) { @@ -520,15 +523,15 @@ public function fieldExists($table, $column) { * unless you are converting a field to be type serial. You can use * the $keys_new argument in all cases. * - * @param $table + * @param string $table * Name of the table. - * @param $field + * @param string $field * Name of the field to change. - * @param $field_new + * @param string $field_new * New name for the field (set to the same as $field if you don't want to change the name). - * @param $spec + * @param array $spec * The field specification for the new field. - * @param $keys_new + * @param array[] $keys_new * (optional) Keys and indexes specification to be created on the * table along with changing the field. The format is the same as a * table specification but without the 'fields' element.