for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Component\Shipping\Checker;
use Sylius\Component\Shipping\Model\ShippingSubjectInterface;
/**
* @author Saša Stamenković <[email protected]>
class UnitCountRuleChecker implements RuleCheckerInterface
{
* {@inheritdoc}
public function isEligible(ShippingSubjectInterface $subject, array $configuration)
$count = $subject->getShippingUnitCount();
if ($configuration['equal']) {
return $count >= $configuration['count'];
}
return $count > $configuration['count'];
public function getConfigurationFormType()
return 'sylius_shipping_rule_unit_count_configuration';