File: D:/HostingSpaces/SBogers10/shop.komma.nl/app/Discounts/Conditions/ProductCountHandler.php
<?php declare(strict_types=1);
namespace App\Discounts\Conditions;
use App\Cart\ShoppingCartItem;
use App\Discounts\DiscountableInterface;
class ProductCountHandler extends CountConditionHandler
{
protected ?int $type = DiscountConditionTypes::PRODUCT_COUNT;
public function canBeApplied(DiscountableInterface $discountable, string $operator, string $param): bool
{
if(!is_a($discountable, ShoppingCartItem::class)) return false;
$result = parent::canBeApplied($discountable, $operator, $param);
return $result;
}
}