From e3d44ff8594069800f08d9ebd911278ed527acc5 Mon Sep 17 00:00:00 2001 From: Claudiu Cristea Date: Mon, 6 May 2024 14:52:43 +0300 Subject: [PATCH] Anticipate method deprecation (#5989) --- phpstan-baseline.neon | 1 + src/Commands/core/MigrateRunnerCommands.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 8c510e283f..7229a21980 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,5 +1,6 @@ parameters: ignoreErrors: + # Remove once MigrationInterface::setRequirements() is added in https://www.drupal.org/i/2796755 - message: "#^Call to an undefined method Drupal\\\\migrate\\\\Plugin\\\\MigrationInterface\\:\\:set\\(\\)\\.$#" count: 1 diff --git a/src/Commands/core/MigrateRunnerCommands.php b/src/Commands/core/MigrateRunnerCommands.php index 03d6de343e..798714c102 100644 --- a/src/Commands/core/MigrateRunnerCommands.php +++ b/src/Commands/core/MigrateRunnerCommands.php @@ -388,6 +388,10 @@ protected function executeMigration(MigrationInterface $migration, string $migra } } if (!empty($userData['options']['force'])) { + // @todo Use the new MigrationInterface::setRequirements() method, + // instead of Migration::set() and remove the PHPStan exception + // from phpstan-baseline.neon when #2796755 lands in Drupal core. + // @see https://www.drupal.org/i/2796755 $migration->set('requirements', []); } if (!empty($userData['options']['update'])) {