From efc5a981e74b332f24bbea7d05c4fdea491cf588 Mon Sep 17 00:00:00 2001 From: mikkamp Date: Mon, 24 Jul 2023 11:55:43 +0100 Subject: [PATCH 1/4] Prevent creation of dynamic property --- src/Proxies/WC.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Proxies/WC.php b/src/Proxies/WC.php index 80fe87578b..1406942364 100644 --- a/src/Proxies/WC.php +++ b/src/Proxies/WC.php @@ -34,6 +34,13 @@ class WC { */ protected $countries; + /** + * List of countries the WC store sells to. + * + * @var array + */ + protected $allowed_countries; + /** @var WC_Countries */ protected $wc_countries; From ac853513309ac023728d586344e44abbf94a4d6f Mon Sep 17 00:00:00 2001 From: mikkamp Date: Mon, 24 Jul 2023 11:56:10 +0100 Subject: [PATCH 2/4] Use correct string replacement --- src/Admin/MetaBox/ChannelVisibilityMetaBox.php | 4 ++-- src/Admin/MetaBox/CouponChannelVisibilityMetaBox.php | 4 ++-- src/Admin/Product/Attributes/AttributesTab.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Admin/MetaBox/ChannelVisibilityMetaBox.php b/src/Admin/MetaBox/ChannelVisibilityMetaBox.php index 70239c20b4..8cdf974fca 100644 --- a/src/Admin/MetaBox/ChannelVisibilityMetaBox.php +++ b/src/Admin/MetaBox/ChannelVisibilityMetaBox.php @@ -105,14 +105,14 @@ public function get_context(): string { public function get_classes(): array { $shown_types = array_map( function ( string $product_type ) { - return "show_if_${product_type}"; + return "show_if_{$product_type}"; }, ProductSyncer::get_supported_product_types() ); $hidden_types = array_map( function ( string $product_type ) { - return "hide_if_${product_type}"; + return "hide_if_{$product_type}"; }, ProductSyncer::get_hidden_product_types() ); diff --git a/src/Admin/MetaBox/CouponChannelVisibilityMetaBox.php b/src/Admin/MetaBox/CouponChannelVisibilityMetaBox.php index 9e29fa8c73..917b4aa609 100644 --- a/src/Admin/MetaBox/CouponChannelVisibilityMetaBox.php +++ b/src/Admin/MetaBox/CouponChannelVisibilityMetaBox.php @@ -110,14 +110,14 @@ public function get_context(): string { public function get_classes(): array { $shown_types = array_map( function ( string $coupon_type ) { - return "show_if_${coupon_type}"; + return "show_if_{$coupon_type}"; }, CouponSyncer::get_supported_coupon_types() ); $hidden_types = array_map( function ( string $coupon_type ) { - return "hide_if_${coupon_type}"; + return "hide_if_{$coupon_type}"; }, CouponSyncer::get_hidden_coupon_types() ); diff --git a/src/Admin/Product/Attributes/AttributesTab.php b/src/Admin/Product/Attributes/AttributesTab.php index 70b5b6f59b..60db105323 100644 --- a/src/Admin/Product/Attributes/AttributesTab.php +++ b/src/Admin/Product/Attributes/AttributesTab.php @@ -102,14 +102,14 @@ function () { private function add_tab( array $tabs ): array { $shown_types = array_map( function ( string $product_type ) { - return "show_if_${product_type}"; + return "show_if_{$product_type}"; }, $this->get_applicable_product_types() ); $hidden_types = array_map( function ( string $product_type ) { - return "hide_if_${product_type}"; + return "hide_if_{$product_type}"; }, ProductSyncer::get_hidden_product_types() ); From d0fff0e45ede9fef87e6df40b2a7530fabe73ec6 Mon Sep 17 00:00:00 2001 From: mikkamp Date: Mon, 24 Jul 2023 12:03:17 +0100 Subject: [PATCH 3/4] Prevent creation of dynamic property in test --- tests/Unit/API/Site/Controllers/CountryCodeTraitTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/Unit/API/Site/Controllers/CountryCodeTraitTest.php b/tests/Unit/API/Site/Controllers/CountryCodeTraitTest.php index 6372bd679f..adc7705aac 100644 --- a/tests/Unit/API/Site/Controllers/CountryCodeTraitTest.php +++ b/tests/Unit/API/Site/Controllers/CountryCodeTraitTest.php @@ -25,6 +25,9 @@ class CountryCodeTraitTest extends TestCase { /** @var MockObject|GoogleHelper $google_helper */ protected $google_helper; + /** @var CountryCodeTrait $trait */ + protected $trait; + /** @var bool $country_supported */ protected $country_supported; From e1af15248e074d78b4b9e50f642762c6c5a8738c Mon Sep 17 00:00:00 2001 From: mikkamp Date: Mon, 24 Jul 2023 12:04:55 +0100 Subject: [PATCH 4/4] Enable unit testing with PHP 8.2 --- .github/workflows/php-unit-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/php-unit-tests.yml b/.github/workflows/php-unit-tests.yml index dbc46fa508..27dab3027a 100644 --- a/.github/workflows/php-unit-tests.yml +++ b/.github/workflows/php-unit-tests.yml @@ -51,6 +51,8 @@ jobs: wp-version: ${{ needs.GetMatrix.outputs.latest-wp-version }} - php: 8.1 wp-version: ${{ needs.GetMatrix.outputs.latest-wp-version }} + - php: 8.2 + wp-version: ${{ needs.GetMatrix.outputs.latest-wp-version }} steps: - name: Checkout repository