From 5f2769b4904a46f09e0d77c38f64b97d1b2f2e43 Mon Sep 17 00:00:00 2001 From: Attila Fulop <1162360+fulopattila122@users.noreply.github.com> Date: Sat, 30 Mar 2024 09:54:09 +0200 Subject: [PATCH] The `Checkout` interface extends `ArrayAccess` and `Shippable` --- Changelog.md | 1 + src/Checkout/Changelog.md | 1 + src/Checkout/CheckoutManager.php | 5 +---- src/Checkout/Contracts/Checkout.php | 4 +++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Changelog.md b/Changelog.md index 79020091..bb428f04 100644 --- a/Changelog.md +++ b/Changelog.md @@ -60,6 +60,7 @@ - Added the `Address` DTO class (implements the `Address` interface) - Added the `AdjusterAliases` class that for decoupling FQCNs from the database - Added automatic mapping of adjuster FQCN <-> aliases when saving an adjustment into the DB and when calling the `getAdjuster()` method +- BC: The `Checkout` interface now extends the `ArrayAccess` and the `Shippable` interfaces (until here, only the concrete classes have implementation it) - BC: Added cart and order item models to the Relation morph map: the `adjustable_type` field in the `adjustments` table needs to be converted! - BC: Added the `?CheckoutSubject` return type to the `getCart()` method of the `Checkout` interface - BC: Changed `Checkout::getShippingAddress()` return type to be nullable diff --git a/src/Checkout/Changelog.md b/src/Checkout/Changelog.md index a81aa22a..aa417942 100644 --- a/src/Checkout/Changelog.md +++ b/src/Checkout/Changelog.md @@ -13,6 +13,7 @@ - Changed minimum Laravel version to v10.38.2 - Changed minimal Enum requirement to v4.2 - Added the `BillpayerChanged` event +- BC: The `Checkout` interface now extends the `ArrayAccess` and the `Shippable` interfaces (until here, only the concrete classes have implementation it) - BC: Added the `?CheckoutSubject` return type to the `getCart()` method of the `Checkout` interface - BC: The unused `$config` parameter has been removed from the `RequestStore` checkout driver constructor - BC: Changed `Checkout::getShippingAddress()` return type to be nullable diff --git a/src/Checkout/CheckoutManager.php b/src/Checkout/CheckoutManager.php index 4a269905..d520623e 100644 --- a/src/Checkout/CheckoutManager.php +++ b/src/Checkout/CheckoutManager.php @@ -23,11 +23,8 @@ use Vanilo\Contracts\CheckoutSubject; use Vanilo\Contracts\DetailedAmount; use Vanilo\Contracts\Dimension; -use Vanilo\Contracts\Shippable; -/** @todo Remove `ArrayAccess` and make the Checkout interface to extend ArrayAccess in v4 */ -/** @todo Remove `Shippable` and make the Checkout interface to extend Shippable in v4 */ -class CheckoutManager implements CheckoutContract, Shippable, \ArrayAccess +class CheckoutManager implements CheckoutContract { use ForwardsCalls; diff --git a/src/Checkout/Contracts/Checkout.php b/src/Checkout/Contracts/Checkout.php index 22841907..e7be3c87 100644 --- a/src/Checkout/Contracts/Checkout.php +++ b/src/Checkout/Contracts/Checkout.php @@ -14,12 +14,14 @@ namespace Vanilo\Checkout\Contracts; +use ArrayAccess; use Vanilo\Contracts\Address; use Vanilo\Contracts\Billpayer; use Vanilo\Contracts\CheckoutSubject; use Vanilo\Contracts\DetailedAmount; +use Vanilo\Contracts\Shippable; -interface Checkout +interface Checkout extends Shippable, ArrayAccess { public function getCart(): ?CheckoutSubject;