feat: add CartConditionable interface and first-class exceptions

This commit is contained in:
Joel Male
2026-05-27 21:23:07 +10:00
parent 4877911cdd
commit e41739c436
4 changed files with 33 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace Wearepixel\Cart\Contracts;
use Wearepixel\Cart\CartCondition;
interface CartConditionable
{
public function toCondition(): CartCondition;
}
@@ -0,0 +1,7 @@
<?php
declare(strict_types=1);
namespace Wearepixel\Cart\Exceptions;
class InvalidCouponException extends \Exception {}
@@ -0,0 +1,7 @@
<?php
declare(strict_types=1);
namespace Wearepixel\Cart\Exceptions;
class InvalidShippingRateException extends \Exception {}
@@ -0,0 +1,7 @@
<?php
declare(strict_types=1);
namespace Wearepixel\Cart\Exceptions;
class InvalidTaxRuleException extends \Exception {}