 .../src/Plugin/migrate/builder/BuilderBase.php     |  5 ++-
 .../destination/ComponentEntityDisplayBase.php     |  5 ++-
 .../src/Plugin/migrate/destination/Config.php      |  5 ++-
 .../Plugin/migrate/destination/DestinationBase.php |  2 +-
 .../src/Plugin/migrate/destination/Entity.php      |  9 ++--
 .../destination/EntityBaseFieldOverride.php        |  2 +
 .../migrate/destination/EntityConfigBase.php       |  2 +-
 .../migrate/destination/EntityContentBase.php      | 10 ++---
 .../migrate/destination/EntityFieldInstance.php    |  2 +
 .../destination/EntityFieldStorageConfig.php       |  2 +
 .../Plugin/migrate/destination/EntityRevision.php  |  6 ++-
 .../Plugin/migrate/destination/EntityViewMode.php  |  2 +
 .../Plugin/migrate/destination/NullDestination.php |  2 +
 .../migrate/src/Plugin/migrate/id_map/Sql.php      | 49 ++++++++++++----------
 14 files changed, 63 insertions(+), 40 deletions(-)

diff --git a/core/modules/migrate/src/Plugin/migrate/builder/BuilderBase.php b/core/modules/migrate/src/Plugin/migrate/builder/BuilderBase.php
index 92a65be..447ebf4 100644
--- a/core/modules/migrate/src/Plugin/migrate/builder/BuilderBase.php
+++ b/core/modules/migrate/src/Plugin/migrate/builder/BuilderBase.php
@@ -9,23 +9,24 @@
 
 use Drupal\Core\Plugin\PluginBase;
 use Drupal\migrate\Entity\Migration;
 use Drupal\migrate\Plugin\MigrateBuilderInterface;
 
 /**
- * Base class for builder plugins.
+ * Provides abstract base class for builder plugins.
  */
 abstract class BuilderBase extends PluginBase implements MigrateBuilderInterface {
 
   /**
    * Returns a fully initialized instance of a source plugin.
    *
    * @param string $plugin_id
    *   The plugin ID.
    * @param array $configuration
-   *   (optional) Additional configuration for the plugin.
+   *   (optional) Additional configuration for the plugin. Defaults to an empty
+   *   array.
    *
    * @return \Drupal\migrate\Plugin\MigrateSourceInterface|\Drupal\migrate\Plugin\RequirementsInterface
    *   The fully initialized source plugin.
    */
   protected function getSourcePlugin($plugin_id, array $configuration = []) {
     $configuration['plugin'] = $plugin_id;
diff --git a/core/modules/migrate/src/Plugin/migrate/destination/ComponentEntityDisplayBase.php b/core/modules/migrate/src/Plugin/migrate/destination/ComponentEntityDisplayBase.php
index f5e5127..dfd1739 100644
--- a/core/modules/migrate/src/Plugin/migrate/destination/ComponentEntityDisplayBase.php
+++ b/core/modules/migrate/src/Plugin/migrate/destination/ComponentEntityDisplayBase.php
@@ -7,12 +7,15 @@
 
 namespace Drupal\migrate\Plugin\migrate\destination;
 
 use Drupal\migrate\Entity\MigrationInterface;
 use Drupal\migrate\Row;
 
+/**
+ * Defines the base abstract class for component entity display.
+ */
 abstract class ComponentEntityDisplayBase extends DestinationBase {
 
   const MODE_NAME = '';
 
   /**
    * {@inheritdoc}
@@ -51,13 +54,13 @@ public function getIds() {
    */
   public function fields(MigrationInterface $migration = NULL) {
     // This is intentionally left empty.
   }
 
   /**
-   * Get the entity.
+   * Gets the entity.
    *
    * @param string $entity_type
    *   The entity type to retrieve.
    * @param string $bundle
    *   The entity bundle.
    * @param string $mode
diff --git a/core/modules/migrate/src/Plugin/migrate/destination/Config.php b/core/modules/migrate/src/Plugin/migrate/destination/Config.php
index 748f1a8..0dd9fd3 100644
--- a/core/modules/migrate/src/Plugin/migrate/destination/Config.php
+++ b/core/modules/migrate/src/Plugin/migrate/destination/Config.php
@@ -1,13 +1,11 @@
 <?php
 
 /**
  * @file
  * Contains \Drupal\migrate\Plugin\migrate\destination\Config.
- *
- * Provides Configuration Management destination plugin.
  */
 
 namespace Drupal\migrate\Plugin\migrate\destination;
 
 use Drupal\Component\Plugin\DependentPluginInterface;
 use Drupal\Core\Config\ConfigFactoryInterface;
@@ -15,22 +13,25 @@
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\migrate\Entity\MigrationInterface;
 use Drupal\migrate\Row;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
+ * Provides Configuration Management destination plugin.
+ *
  * Persist data to the config system.
  *
  * When a property is NULL, the default is used unless the configuration option
  * 'store null' is set to TRUE.
  *
  * @MigrateDestination(
  *   id = "config"
  * )
  */
 class Config extends DestinationBase implements ContainerFactoryPluginInterface, DependentPluginInterface {
+
   use DependencyTrait;
 
   /**
    * The config object.
    *
    * @var \Drupal\Core\Config\Config
diff --git a/core/modules/migrate/src/Plugin/migrate/destination/DestinationBase.php b/core/modules/migrate/src/Plugin/migrate/destination/DestinationBase.php
index 93f3b83..0a38ba8 100644
--- a/core/modules/migrate/src/Plugin/migrate/destination/DestinationBase.php
+++ b/core/modules/migrate/src/Plugin/migrate/destination/DestinationBase.php
@@ -2,13 +2,12 @@
 
 /**
  * @file
  * Contains \Drupal\migrate\Plugin\migrate\destination\DestinationBase.
  */
 
-
 namespace Drupal\migrate\Plugin\migrate\destination;
 
 use Drupal\Core\Plugin\PluginBase;
 use Drupal\migrate\Entity\MigrationInterface;
 use Drupal\migrate\Exception\RequirementsException;
 use Drupal\migrate\Plugin\MigrateDestinationInterface;
@@ -110,7 +109,8 @@ protected function setRollbackAction(array $id_map) {
     // Otherwise, we're updating an entity which already existed on the
     // destination and want to make sure we do not delete it on rollback.
     else {
       $this->rollbackAction = MigrateIdMapInterface::ROLLBACK_PRESERVE;
     }
   }
+
 }
diff --git a/core/modules/migrate/src/Plugin/migrate/destination/Entity.php b/core/modules/migrate/src/Plugin/migrate/destination/Entity.php
index 50e477d..c8cca65 100644
--- a/core/modules/migrate/src/Plugin/migrate/destination/Entity.php
+++ b/core/modules/migrate/src/Plugin/migrate/destination/Entity.php
@@ -13,18 +13,21 @@
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\migrate\Entity\MigrationInterface;
 use Drupal\migrate\Row;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
+ * Provides entity destination plugin.
+ *
  * @MigrateDestination(
  *   id = "entity",
  *   deriver = "Drupal\migrate\Plugin\Derivative\MigrateEntity"
  * )
  */
 abstract class Entity extends DestinationBase implements ContainerFactoryPluginInterface, DependentPluginInterface {
+
   use DependencyTrait;
 
   /**
    * The entity storage.
    *
    * @var \Drupal\Core\Entity\EntityStorageInterface
@@ -83,13 +86,13 @@ public static function create(ContainerInterface $container, array $configuratio
    *   The plugin ID.
    *
    * @return string
    *   The entity type.
    */
   protected static function getEntityTypeId($plugin_id) {
-    // Remove "entity:"
+    // Remove "entity:".
     return substr($plugin_id, 7);
   }
 
   /**
    * {@inheritdoc}
    */
@@ -122,19 +125,19 @@ protected function getEntity(Row $row, array $old_destination_id_values) {
       $entity->enforceIsNew();
     }
     return $entity;
   }
 
   /**
-   * Get the entity ID of the row.
+   * Gets the entity ID of the row.
    *
    * @param \Drupal\migrate\Row $row
    *   The row of data.
    *
    * @return string
-   *   The entity ID for the row we are importing.
+   *   The entity ID for the row that we are importing.
    */
   protected function getEntityId(Row $row) {
     return $row->getDestinationProperty($this->getKey('id'));
   }
 
   /**
diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityBaseFieldOverride.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityBaseFieldOverride.php
index 2e2de4b..2501b53 100644
--- a/core/modules/migrate/src/Plugin/migrate/destination/EntityBaseFieldOverride.php
+++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityBaseFieldOverride.php
@@ -7,12 +7,14 @@
 
 namespace Drupal\migrate\Plugin\migrate\destination;
 
 use Drupal\migrate\Row;
 
 /**
+ * Provides entity base field override plugin.
+ *
  * @MigrateDestination(
  *   id = "entity:base_field_override"
  * )
  */
 class EntityBaseFieldOverride extends EntityConfigBase {
 
diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php
index b9e2e7c..382f32a 100644
--- a/core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php
+++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php
@@ -102,13 +102,13 @@ protected function updateEntityProperty(EntityInterface $entity, array $parents,
       $entity_value = $value;
     }
     $entity->set($top_key, $entity_value);
   }
 
   /**
-   * Generate an entity ID.
+   * Generates an entity ID.
    *
    * @param \Drupal\migrate\Row $row
    *   The current row.
    * @param array $ids
    *   The destination IDs.
    *
diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php
index 33f747a..f23b54f 100644
--- a/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php
+++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php
@@ -4,21 +4,18 @@
  * @file
  * Contains \Drupal\migrate\Plugin\migrate\destination\EntityContentBase.
  */
 
 namespace Drupal\migrate\Plugin\migrate\destination;
 
-use Drupal\Component\Utility\Random;
-use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Entity\ContentEntityInterface;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Field\FieldTypePluginManagerInterface;
 use Drupal\Core\TypedData\TypedDataInterface;
-use Drupal\link\LinkItemInterface;
 use Drupal\migrate\Entity\MigrationInterface;
 use Drupal\migrate\MigrateException;
 use Drupal\migrate\Plugin\MigrateIdMapInterface;
 use Drupal\migrate\Row;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -94,13 +91,13 @@ public function import(Row $row, array $old_destination_id_values = array()) {
       throw new MigrateException('Unable to get entity');
     }
     return $this->save($entity, $old_destination_id_values);
   }
 
   /**
-   * Save the entity.
+   * Saves the entity.
    *
    * @param \Drupal\Core\Entity\ContentEntityInterface $entity
    *   The content entity.
    * @param array $old_destination_id_values
    *   (optional) An array of destination ID values. Defaults to an empty array.
    *
@@ -119,13 +116,13 @@ public function getIds() {
     $id_key = $this->getKey('id');
     $ids[$id_key]['type'] = 'integer';
     return $ids;
   }
 
   /**
-   * Update an entity with the new values from row.
+   * Updates an entity with the new values from row.
    *
    * @param \Drupal\Core\Entity\EntityInterface $entity
    *   The entity to update.
    * @param \Drupal\migrate\Row $row
    *   The row object to update from.
    */
@@ -149,13 +146,13 @@ protected function updateEntity(EntityInterface $entity, Row $row) {
     }
 
     $this->setRollbackAction($row->getIdMap());
   }
 
   /**
-   * Do as much population of the stub row as we can.
+   * Populates as much of the stub row as possible.
    *
    * @param \Drupal\migrate\Row $row
    *   The row of data.
    */
   protected function processStubRow(Row $row) {
     $bundle_key = $this->getKey('bundle');
@@ -182,13 +179,12 @@ protected function processStubRow(Row $row) {
           $field_type_class = $this->fieldTypeManager
             ->getPluginClass($field_definition->getType());
           $values = $field_type_class::generateSampleValue($field_definition);
           if (is_null($values)) {
             // Handle failure to generate a sample value.
             throw new MigrateException('Stubbing failed, unable to generate value for field ' . $field_name);
-            break;
           }
         }
 
         $row->setDestinationProperty($field_name, $values);
       }
     }
diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityFieldInstance.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityFieldInstance.php
index c6cd7e4..5d2f902 100644
--- a/core/modules/migrate/src/Plugin/migrate/destination/EntityFieldInstance.php
+++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityFieldInstance.php
@@ -5,12 +5,14 @@
  * Contains \Drupal\migrate\Plugin\migrate\destination\EntityFieldInstance.
  */
 
 namespace Drupal\migrate\Plugin\migrate\destination;
 
 /**
+ * Provides entity field instance plugin.
+ *
  * @MigrateDestination(
  *   id = "entity:field_config"
  * )
  */
 class EntityFieldInstance extends EntityConfigBase {
 
diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityFieldStorageConfig.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityFieldStorageConfig.php
index 31f7a13..9b374c6 100644
--- a/core/modules/migrate/src/Plugin/migrate/destination/EntityFieldStorageConfig.php
+++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityFieldStorageConfig.php
@@ -5,12 +5,14 @@
  * Contains \Drupal\migrate\Plugin\migrate\destination\EntityFieldStorageConfig.
  */
 
 namespace Drupal\migrate\Plugin\migrate\destination;
 
 /**
+ * Provides entity field storage configuration plugin.
+ *
  * @MigrateDestination(
  *   id = "entity:field_storage_config"
  * )
  */
 class EntityFieldStorageConfig extends EntityConfigBase {
 
diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php
index 81498c3..24602b6 100644
--- a/core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php
+++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php
@@ -9,12 +9,14 @@
 
 use Drupal\Core\Entity\ContentEntityInterface;
 use Drupal\migrate\MigrateException;
 use Drupal\migrate\Row;
 
 /**
+ * Provides entity revision destination plugin.
+ *
  * @MigrateDestination(
  *   id = "entity_revision",
  *   deriver = "Drupal\migrate\Plugin\Derivative\MigrateEntityRevision"
  * )
  */
 class EntityRevision extends EntityContentBase {
@@ -25,18 +27,18 @@ class EntityRevision extends EntityContentBase {
   protected static function getEntityTypeId($plugin_id) {
     // Remove entity_revision:
     return substr($plugin_id, 16);
   }
 
   /**
-   * Get the entity.
+   * Gets the entity.
    *
    * @param \Drupal\migrate\Row $row
    *   The row object.
    * @param array $old_destination_id_values
-   *   The old destination ids.
+   *   The old destination IDs.
    *
    * @return \Drupal\Core\Entity\EntityInterface|false
    *   The entity or false if it can not be created.
    */
   protected function getEntity(Row $row, array $old_destination_id_values) {
     $revision_id = $old_destination_id_values ?
diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php
index 87fe204..61bb0eb 100644
--- a/core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php
+++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php
@@ -5,12 +5,14 @@
  * Contains \Drupal\migrate\Plugin\migrate\destination\EntityViewMode.
  */
 
 namespace Drupal\migrate\Plugin\migrate\destination;
 
 /**
+ * Provides entity view mode destination plugin.
+ *
  * @MigrateDestination(
  *   id = "entity:entity_view_mode"
  * )
  */
 class EntityViewMode extends EntityConfigBase {
 
diff --git a/core/modules/migrate/src/Plugin/migrate/destination/NullDestination.php b/core/modules/migrate/src/Plugin/migrate/destination/NullDestination.php
index 1bffa9e..f35c5d4 100644
--- a/core/modules/migrate/src/Plugin/migrate/destination/NullDestination.php
+++ b/core/modules/migrate/src/Plugin/migrate/destination/NullDestination.php
@@ -8,12 +8,14 @@
 namespace Drupal\migrate\Plugin\migrate\destination;
 
 use Drupal\migrate\Entity\MigrationInterface;
 use Drupal\migrate\Row;
 
 /**
+ * Provides null destination plugin.
+ *
  * @MigrateDestination(
  *   id = "null",
  *   requirements_met = false
  * )
  */
 class NullDestination extends DestinationBase {
diff --git a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
index 4ed4baa..9005ef2 100644
--- a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
+++ b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
@@ -66,12 +66,14 @@ class Sql extends PluginBase implements MigrateIdMapInterface, ContainerFactoryP
    *
    * @var \Drupal\Core\Database\Connection
    */
   protected $database;
 
   /**
+   * The select query.
+   *
    * @var \Drupal\Core\Database\Query\SelectInterface
    */
   protected $query;
 
   /**
    * The migration being done.
@@ -380,42 +382,46 @@ protected function ensureTables() {
       }
     }
     else {
       // Add any missing columns to the map table.
       if (!$this->getDatabase()->schema()->fieldExists($this->mapTableName,
                                                     'rollback_action')) {
-        $this->getDatabase()->schema()->addField($this->mapTableName,
-                                              'rollback_action', array(
-          'type' => 'int',
-          'size' => 'tiny',
-          'unsigned' => TRUE,
-          'not null' => TRUE,
-          'default' => 0,
-          'description' => 'Flag indicating what to do for this item on rollback',
-        ));
+        $this->getDatabase()->schema()->addField($this->mapTableName, 'rollback_action',
+          array(
+            'type' => 'int',
+            'size' => 'tiny',
+            'unsigned' => TRUE,
+            'not null' => TRUE,
+            'default' => 0,
+            'description' => 'Flag indicating what to do for this item on rollback',
+          )
+        );
       }
       if (!$this->getDatabase()->schema()->fieldExists($this->mapTableName, 'hash')) {
-        $this->getDatabase()->schema()->addField($this->mapTableName, 'hash', array(
-          'type' => 'varchar',
-          'length' => '64',
-          'not null' => FALSE,
-          'description' => 'Hash of source row data, for detecting changes',
-        ));
+        $this->getDatabase()->schema()->addField($this->mapTableName, 'hash',
+          array(
+            'type' => 'varchar',
+            'length' => '64',
+            'not null' => FALSE,
+            'description' => 'Hash of source row data, for detecting changes',
+          )
+        );
       }
     }
   }
 
   /**
    * Creates schema from an ID definition.
    *
    * @param array $id_definition
    *   A field schema definition. Can be SQL schema or a type data
    *   based schema. In the latter case, the value of type needs to be
-   *   $typed_data_type.$column
+   *   $typed_data_type.$column.
    *
    * @return array
+   *   The schema definition.
    */
   protected function getFieldSchema(array $id_definition) {
     $type_parts = explode('.', $id_definition['type']);
     if (count($type_parts) == 1) {
       $type_parts[] = 'value';
     }
@@ -591,14 +597,14 @@ public function getMessageIterator(array $source_id_values = [], $level = NULL)
 
   /**
    * {@inheritdoc}
    */
   public function prepareUpdate() {
     $this->getDatabase()->update($this->mapTableName())
-    ->fields(array('source_row_status' => MigrateIdMapInterface::STATUS_NEEDS_UPDATE))
-    ->execute();
+      ->fields(array('source_row_status' => MigrateIdMapInterface::STATUS_NEEDS_UPDATE))
+      ->execute();
   }
 
   /**
    * {@inheritdoc}
    */
   public function processedCount() {
@@ -640,16 +646,17 @@ public function messageCount() {
     return $this->countHelper(NULL, $this->messageTableName());
   }
 
   /**
    * Counts records in a table.
    *
-   * @param $status
+   * @param int $status
    *   An integer for the source_row_status column.
-   * @param $table
-   *   The table to work
+   * @param string $table
+   *   (optional) The table to work. Defaults to NULL.
+   *
    * @return int
    *   The number of records.
    */
   protected function countHelper($status, $table = NULL) {
     $query = $this->getDatabase()->select($table ?: $this->mapTableName());
     if (isset($status)) {
