Skip to content

Commit b0b2620

Browse files
authored
Merge pull request #202 from aligent/fix/201-creation-of-dynamic-properties-deprecated-in-php8
Fix/201 creation of dynamic properties deprecated in php8
2 parents 1e71e40 + 5b67398 commit b0b2620

33 files changed

+242
-88
lines changed

RELEASE_NOTES.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
This release adds support for a number of new and extended BigCommerce V3 API endpoints.
2-
3-
### New Features
4-
5-
- Implement the [System Logs](https://developer.bigcommerce.com/api-reference/6908d02370409-get-system-logs)
6-
endpoint (#185)
7-
- Implement the [Pages](https://developer.bigcommerce.com/api-reference/d74089ee212a2-delete-pages) API (#184)
8-
- Implement extra Customer V3 endpoints (#181):
9-
- [Get stored instruments](https://developer.bigcommerce.com/api-reference/b735a25b3a0b8-get-stored-instruments)
10-
- [Customer Settings](https://developer.bigcommerce.com/api-reference/0c31a6d25e5ea-get-customer-settings)
11-
- [Customer Settings per Channel](https://developer.bigcommerce.com/api-reference/d5e66c45b0415-get-customer-settings-per-channel)
12-
- [Validate credentials](https://developer.bigcommerce.com/api-reference/3d731215a3dcb-validate-a-customer-credentials)
13-
- Add the ability to send and receive Images via the Product API, not just the Product Images api (#175)
14-
- Implement the [Wishlists](https://developer.bigcommerce.com/api-reference/03d6065d6f6e5-wishlist) API (#186)
15-
1+
### Fixes
162

3+
- Many deprecation notices for PHP 8.2 about creation of dynamic properties (#201)

src/BigCommerce/ResourceModels/Cart/Cart.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,11 @@ class Cart extends ResourceModel
2222
public string $updated_time;
2323
public int $channel_id;
2424
public string $locale;
25+
public ?CartRedirectUrls $redirect_urls;
26+
27+
protected function beforeBuildObject(): void
28+
{
29+
parent::beforeBuildObject();
30+
self::buildPropertyObject('redirect_urls', CartRedirectUrls::class);
31+
}
2532
}

src/BigCommerce/ResourceModels/Cart/CartRedirectUrls.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ class CartRedirectUrls extends ResourceModel
88
{
99
public string $cart_url;
1010
public string $checkout_url;
11+
public string $embedded_checkout_url;
1112
}

src/BigCommerce/ResourceModels/Catalog/Product/Product.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ class Product extends ResourceModel
8181
public bool $open_graph_use_image;
8282
public int $reviews_rating_sum;
8383
public int $total_sold;
84+
public int $reviews_count;
85+
public ?int $option_set_id;
86+
public ?float $calculated_price;
87+
public ?string $option_set_display;
88+
public string $product_tax_code;
89+
public int $tax_class_id;
90+
public ?float $map_price;
91+
8492
/**
8593
* @var CustomField[]|null
8694
*/
@@ -97,6 +105,11 @@ class Product extends ResourceModel
97105
*/
98106
public ?array $images;
99107

108+
/**
109+
* @var ProductVariant[]|null
110+
*/
111+
public ?array $variants;
112+
100113
public function __construct(?stdClass $optionObject = null)
101114
{
102115
if (!is_null($optionObject)) {
@@ -126,5 +139,6 @@ protected function beforeBuildObject(): void
126139
{
127140
$this->buildObjectArray('modifiers', ProductModifier::class);
128141
$this->buildObjectArray('images', ProductImage::class);
142+
$this->buildObjectArray('variants', ProductVariant::class);
129143
}
130144
}

src/BigCommerce/ResourceModels/Catalog/Product/ProductVariant.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class ProductVariant extends ResourceModel
1212
public ?int $sku_id;
1313
public ?float $price;
1414
public ?float $calculated_price;
15+
public ?float $map_price;
1516
public ?float $sale_price;
1617
public ?float $retail_price;
1718
public ?float $weight;
@@ -31,4 +32,5 @@ class ProductVariant extends ResourceModel
3132
public int $inventory_warning_level;
3233
public string $bin_picking_number;
3334
public array $option_values;
35+
public float $calculated_weight;
3436
}

src/BigCommerce/ResourceModels/Catalog/Product/ProductVideo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ProductVideo extends ResourceModel
1010

1111
public string $title;
1212
public string $description;
13-
public int $sort_oder;
13+
public int $sort_order;
1414
public string $type;
1515
public string $video_id;
1616
public int $id;

src/BigCommerce/ResourceModels/Channel/Channel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,5 @@ class Channel extends ResourceModel
4444
public bool $is_visible;
4545
public string $name;
4646
public string $status;
47+
public bool $is_enabled;
4748
}

src/BigCommerce/ResourceModels/Customer/Customer.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ class Customer extends ResourceModel
3232
public ?array $store_credit_amounts;
3333
public ?int $origin_channel_id;
3434
public ?array $channel_ids;
35+
public ?string $registration_ip_address;
36+
public string $date_created;
37+
public string $date_modified;
3538

3639
/**
3740
* @var CustomerAddress[]

src/BigCommerce/ResourceModels/Customer/CustomerAddress.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ class CustomerAddress extends ResourceModel
1717
public string $phone;
1818
public string $address_type;
1919
public int $customer_id;
20+
public ?string $company;
2021
}

src/BigCommerce/ResourceModels/Order/OrderRefundItem.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ class OrderRefundItem extends ResourceModel
1616
public ?float $amount;
1717
public ?float $quantity;
1818
public ?string $reason;
19+
public ?float $requested_amount;
1920
}

0 commit comments

Comments
 (0)