Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feat-promotion' into feat-promotion
Browse files Browse the repository at this point in the history
  • Loading branch information
fulopattila122 committed Jul 15, 2024
2 parents 1765953 + 90f1d68 commit 68b8383
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion src/Promotion/Models/PromotionRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use Vanilo\Promotion\PromotionRuleTypes;
use Vanilo\Support\Dto\SchemaDefinition;
use Vanilo\Support\Traits\ConfigurableModel;
use Vanilo\Support\Traits\ConfigurationHasNoSchema;

/**
* @property int $id
Expand Down
2 changes: 1 addition & 1 deletion src/Promotion/Rules/CartQuantity.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function getSchemaSample(array $mergeWith = null): array

public function isPassing(object $subject, array $configuration): bool
{
$count = match(true) {
$count = match (true) {
method_exists($subject, 'itemCount') => $subject->itemCount(),
method_exists($subject, 'getItems') => count($subject->getItems()),
default => throw new \InvalidArgumentException('The cart quantity promotion rule requires either `itemCount()` or `getItems()` method on its subject'),
Expand Down

0 comments on commit 68b8383

Please sign in to comment.