diff --git a/core/modules/config_translation/src/Plugin/migrate/process/I18nBlockSettings.php b/core/modules/config_translation/src/Plugin/migrate/process/I18nBlockSettings.php index 71f79d5..fbdd6d9 100644 --- a/core/modules/config_translation/src/Plugin/migrate/process/I18nBlockSettings.php +++ b/core/modules/config_translation/src/Plugin/migrate/process/I18nBlockSettings.php @@ -21,7 +21,7 @@ class I18nBlockSettings extends ProcessPluginBase { */ public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { list($plugin, $delta, $old_settings, $title) = $value; - $settings = array(); + $settings = []; $settings['label'] = $title; if ($title) { $settings['label_display'] = BlockInterface::BLOCK_LABEL_VISIBLE; diff --git a/core/modules/config_translation/src/Plugin/migrate/process/Substr.php b/core/modules/config_translation/src/Plugin/migrate/process/Substr.php index 55a8e42..3821510 100644 --- a/core/modules/config_translation/src/Plugin/migrate/process/Substr.php +++ b/core/modules/config_translation/src/Plugin/migrate/process/Substr.php @@ -15,7 +15,6 @@ * id = "substr" * ) */ - class Substr extends ProcessPluginBase { public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { diff --git a/core/modules/config_translation/src/Plugin/migrate/source/d6/I18nBlock.php b/core/modules/config_translation/src/Plugin/migrate/source/d6/I18nBlock.php index 5972b7e..443f1a7 100644 --- a/core/modules/config_translation/src/Plugin/migrate/source/d6/I18nBlock.php +++ b/core/modules/config_translation/src/Plugin/migrate/source/d6/I18nBlock.php @@ -4,6 +4,7 @@ use Drupal\migrate\Row; use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase; + /** * Gets i18n string block data from source database. * @@ -46,9 +47,9 @@ public function query() { $this->blockTable = 'blocks'; } $query = $this->select('i18n_strings', 'i18n') - ->fields('i18n', array('lid', 'type', 'property', 'objectid')) - ->fields('lt', array('lid', 'language', 'translation')) - ->fields('b', array('bid', 'module', 'delta', 'theme')) + ->fields('i18n', ['lid', 'type', 'property', 'objectid']) + ->fields('lt', ['lid', 'language', 'translation']) + ->fields('b', ['bid', 'module', 'delta', 'theme']) ->condition('i18n.type', 'block'); $query->leftJoin($this->blockTable, 'b', 'b.bid = i18n.objectid'); $query->leftJoin('locales_target', 'lt', 'lt.lid = i18n.lid'); @@ -68,14 +69,15 @@ protected function initializeIterator() { * {@inheritdoc} */ public function fields() { - return array( + return [ 'bid' => $this->t('The block numeric identifier.'), 'module' => $this->t('The module providing the block.'), 'delta' => $this->t('The block\'s delta.'), 'theme' => $this->t('Which theme the block is placed in.'), 'language' => $this->t('Language for this field.'), 'property' => $this->t('Name of property being translated.'), - 'translation' => $this->t('Translation of either the title or explanation.')); + 'translation' => $this->t('Translation of either the title or explanation.' + )]; } /** @@ -88,6 +90,7 @@ public function getIds() { $ids['language']['type'] = 'string'; return $ids; } + /** * {@inheritdoc} */ diff --git a/core/modules/content_translation/src/Plugin/migrate/source/d6/I18nBox.php b/core/modules/content_translation/src/Plugin/migrate/source/d6/I18nBox.php index 0da39cc..1d5edf4 100644 --- a/core/modules/content_translation/src/Plugin/migrate/source/d6/I18nBox.php +++ b/core/modules/content_translation/src/Plugin/migrate/source/d6/I18nBox.php @@ -62,9 +62,9 @@ protected function values() { */ public function query() { $query = $this->select('i18n_strings', 'i18n') - ->fields('i18n', array('lid', 'type', 'property', 'objectid')) - ->fields('lt', array('lid', 'language', 'translation')) - ->fields('b', array('bid', 'body', 'info', 'format')) + ->fields('i18n', ['lid', 'type', 'property', 'objectid']) + ->fields('lt', ['lid', 'language', 'translation']) + ->fields('b', ['bid', 'body', 'info', 'format']) ->orderBy('bid') ->orderBy('language') ->orderBy('property') @@ -81,13 +81,13 @@ public function query() { * {@inheritdoc} */ public function fields() { - return array( + return [ 'bid' => $this->t('The block numeric identifier.'), 'language' => $this->t('Language for this field.'), 'body' => $this->t('The block/box content'), 'info' => $this->t('Admin title of the block/box.'), 'format' => $this->t('Input format of the custom block/box content.') - ); + ]; } /** diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php index 596ed8b..af9cb7f 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php @@ -31,8 +31,7 @@ class EntityConfigBase extends Entity { * @var \Drupal\Core\Language\LanguageManagerInterface */ protected $languageManager; - - /** + /** * Construct a new entity. * @@ -75,7 +74,7 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} */ - public function import(Row $row, array $old_destination_id_values = array()) { + public function import(Row $row, array $old_destination_id_values = []) { if ($row->isStub()) { throw new MigrateException('Config entities can not be stubbed.'); } @@ -95,13 +94,13 @@ public function import(Row $row, array $old_destination_id_values = array()) { if (count($ids) > 1) { // This can only be a config entity, content entities have their ID key // and that's it. - $return = array(); + $return = []; foreach ($id_keys as $id_key) { $return[] = $entity->get($id_key); } return $return; } - return array($entity->id()); + return [$entity->id()]; } /** @@ -171,7 +170,7 @@ protected function updateEntityProperty(EntityInterface $entity, array $parents, * The generated entity ID. */ protected function generateId(Row $row, array $ids) { - $id_values = array(); + $id_values = []; foreach ($ids as $id) { $id_values[] = $row->getDestinationProperty($id); } diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php index 19d47e5..52b094c 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php @@ -93,7 +93,7 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} */ - public function import(Row $row, array $old_destination_id_values = array()) { + public function import(Row $row, array $old_destination_id_values = []) { $this->rollbackAction = MigrateIdMapInterface::ROLLBACK_DELETE; $entity = $this->getEntity($row, $old_destination_id_values); if (!$entity) { @@ -118,9 +118,9 @@ public function import(Row $row, array $old_destination_id_values = array()) { * @return array * An array containing the entity ID. */ - protected function save(ContentEntityInterface $entity, array $old_destination_id_values = array()) { + protected function save(ContentEntityInterface $entity, array $old_destination_id_values = []) { $entity->save(); - return array($entity->id()); + return [$entity->id()]; } /**