From b7a37e69b7c24f78b88f9a80283e8ef2b07a8ea1 Mon Sep 17 00:00:00 2001 From: Brezo Cordero <8002881+brezocordero@users.noreply.github.com> Date: Thu, 19 May 2022 09:57:01 -0500 Subject: [PATCH] Init $customerRoleAdded on WooCommerceTest.php This will make it non-nullable and have only the type bool. [MAILPOET-3720] --- mailpoet/tests/integration/Segments/WooCommerceTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mailpoet/tests/integration/Segments/WooCommerceTest.php b/mailpoet/tests/integration/Segments/WooCommerceTest.php index 7afab16f4b..11616c2d30 100644 --- a/mailpoet/tests/integration/Segments/WooCommerceTest.php +++ b/mailpoet/tests/integration/Segments/WooCommerceTest.php @@ -24,7 +24,7 @@ require_once('WPTestUser.php'); class WooCommerceTest extends \MailPoetTest { /** @var bool */ - public $customerRoleAdded; + public $customerRoleAdded = false; /** @var string[] */ private $userEmails = []; @@ -621,7 +621,7 @@ class WooCommerceTest extends \MailPoetTest { } private function removeCustomerRole(): void { - if (!empty($this->customerRoleAdded)) { + if ($this->customerRoleAdded) { remove_role('customer'); } }