Skip to content

Commit

Permalink
Merge pull request #2022 from woocommerce/fix/2021-php82-deprecations
Browse files Browse the repository at this point in the history
PHP 8.2 Deprecation Messages
  • Loading branch information
mikkamp authored Jul 25, 2023
2 parents d3beceb + e1af152 commit d12eb24
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/php-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Admin/MetaBox/ChannelVisibilityMetaBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
Expand Down
4 changes: 2 additions & 2 deletions src/Admin/MetaBox/CouponChannelVisibilityMetaBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
Expand Down
4 changes: 2 additions & 2 deletions src/Admin/Product/Attributes/AttributesTab.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
Expand Down
7 changes: 7 additions & 0 deletions src/Proxies/WC.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 3 additions & 0 deletions tests/Unit/API/Site/Controllers/CountryCodeTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit d12eb24

Please sign in to comment.