diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Upsert.php b/core/lib/Drupal/Core/Database/Driver/mysql/Upsert.php index 5829fcd..c650bfb 100644 --- a/core/lib/Drupal/Core/Database/Driver/mysql/Upsert.php +++ b/core/lib/Drupal/Core/Database/Driver/mysql/Upsert.php @@ -149,5 +149,4 @@ public function __toString() { return $query; } - } diff --git a/core/lib/Drupal/Core/Database/Query/Upsert.php b/core/lib/Drupal/Core/Database/Query/Upsert.php index 74121f7..b1858e9 100644 --- a/core/lib/Drupal/Core/Database/Query/Upsert.php +++ b/core/lib/Drupal/Core/Database/Query/Upsert.php @@ -122,7 +122,7 @@ public function __construct(Connection $connection, $table, array $options = arr /** * Adds a set of field->value pairs to be updated. * - * @param $fields + * @param array $fields * An associative array of fields to write into the database. The array keys * are the field names and the values are the values to which to set them. * @@ -139,8 +139,11 @@ public function updateFields(array $fields) { * A list of fields to update to the same value as they would be on INSERT. * * @param array $fields + * An associative array of fields to write into the database. The array keys + * are the field names and the values are the values to which to set them. * * @return $this + * The called object. */ public function updateValues(array $fields) { $this->updateValues = $fields; @@ -160,7 +163,7 @@ public function updateValues(array $fields) { * @param $expression * The field will be set to the value of this expression. This parameter * may include named placeholders. - * @param $arguments + * @param array $arguments * If specified, this is an array of key/value pairs for named placeholders * corresponding to the expression. * @@ -299,11 +302,14 @@ public function insertValues(array $values) { /** * Preprocesses and validates the query. * - * @return + * @return bool * TRUE if the validation was successful, FALSE if not. * * @throws \Drupal\Core\Database\Query\FieldsOverlapException + * If an identical field and default value are specified. + * * @throws \Drupal\Core\Database\Query\NoFieldsException + * If there are no fields to insert. */ public function preExecute() { // Confirm that the user did not try to specify an identical diff --git a/core/modules/system/src/Tests/Database/UpsertTest.php b/core/modules/system/src/Tests/Database/UpsertTest.php index be1cbfb..2c036c5 100644 --- a/core/modules/system/src/Tests/Database/UpsertTest.php +++ b/core/modules/system/src/Tests/Database/UpsertTest.php @@ -5,7 +5,6 @@ * Contains \Drupal\system\Tests\Database\UpsertTest. */ - namespace Drupal\system\Tests\Database; @@ -22,7 +21,7 @@ class UpsertTest extends DatabaseTestBase { /** * Confirms that we can merge-insert a record successfully. */ - function testMergeInsert() { + public function testMergeInsert() { $connection = Database::getConnection(); $num_records_before = $connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField(); @@ -48,7 +47,7 @@ function testMergeInsert() { /** * Confirms that we can merge-update a record successfully. */ - function testMergeUpdate() { + public function testMergeUpdate() { $connection = Database::getConnection(); $num_records_before = $connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField();