From 8adabbe3d4ffec36d2fbbabb0e6bc42683e6c62b Mon Sep 17 00:00:00 2001 From: Ante Laca Date: Mon, 25 Mar 2024 13:32:17 +0100 Subject: [PATCH] refactor: use canHandle method --- src/FormMigration/Steps/DoubleTheDonation.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/FormMigration/Steps/DoubleTheDonation.php b/src/FormMigration/Steps/DoubleTheDonation.php index acd46e51bf..49000c10de 100644 --- a/src/FormMigration/Steps/DoubleTheDonation.php +++ b/src/FormMigration/Steps/DoubleTheDonation.php @@ -14,12 +14,16 @@ class DoubleTheDonation extends FormMigrationStep /** * @unreleased */ - public function process() + public function canHandle(): bool { - if ($this->formV2->getDoubleTheDonationStatus() !== 'enabled') { - return; - } + return $this->formV2->getDoubleTheDonationStatus() === 'enabled'; + } + /** + * @unreleased + */ + public function process() + { $block = BlockModel::make([ 'name' => 'givewp/dtd', 'attributes' => [