From dd06e6dfa41ed73819726656d37ecd49ee2a332e Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Tue, 15 Dec 2015 17:33:59 +0000 Subject: [PATCH] Issue #2626476 by benjy: MigrationBuilder should have an interface --- core/modules/migrate/src/MigrationBuilder.php | 11 ++------ .../migrate/src/MigrationBuilderInterface.php | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 core/modules/migrate/src/MigrationBuilderInterface.php diff --git a/core/modules/migrate/src/MigrationBuilder.php b/core/modules/migrate/src/MigrationBuilder.php index e4c4658e1ebf..bdf3e4e42a09 100644 --- a/core/modules/migrate/src/MigrationBuilder.php +++ b/core/modules/migrate/src/MigrationBuilder.php @@ -13,7 +13,7 @@ /** * Builds migration entities from migration templates. */ -class MigrationBuilder { +class MigrationBuilder implements MigrationBuilderInterface { /** * The builder plugin manager. @@ -33,14 +33,7 @@ public function __construct(MigratePluginManager $builder_manager) { } /** - * Builds migration entities from templates. - * - * @param array $templates - * The parsed templates (each of which is an array parsed from YAML), keyed - * by ID. - * - * @return \Drupal\migrate\Entity\MigrationInterface[] - * The migration entities derived from the templates. + * {@inheritdoc} */ public function createMigrations(array $templates) { /** @var \Drupal\migrate\Entity\MigrationInterface[] $migrations */ diff --git a/core/modules/migrate/src/MigrationBuilderInterface.php b/core/modules/migrate/src/MigrationBuilderInterface.php new file mode 100644 index 000000000000..66f3078e53df --- /dev/null +++ b/core/modules/migrate/src/MigrationBuilderInterface.php @@ -0,0 +1,27 @@ +<?php + +/** + * @file + * Contains \Drupal\migrate\MigrationBuilderInterface. + */ + +namespace Drupal\migrate; + +/** + * The migration builder interface. + */ +interface MigrationBuilderInterface { + + /** + * Builds migration entities from templates. + * + * @param array $templates + * The parsed templates (each of which is an array parsed from YAML), keyed + * by ID. + * + * @return \Drupal\migrate\Entity\MigrationInterface[] + * The migration entities derived from the templates. + */ + public function createMigrations(array $templates); + +} -- GitLab