public static function greaterThan($value, $limit, $message = '')
{
if ($value <= $limit) {
static::reportInvalidArgument(sprintf($message ?: 'Expected a value greater than %2$s. Got: %s', static::valueToString($value), static::valueToString($limit)));
}
}
/** * {@inheritdoc} */ public function release(StockableInterface $stockable, $quantity) { Assert::greaterThan($quantity, 0, 'Quantity of units must be greater than 0.'); $this->dispatchEvent(SyliusStockableEvents::PRE_RELEASE, $stockable); $stockable->setOnHold($stockable->getOnHold() - $quantity); $this->dispatchEvent(SyliusStockableEvents::POST_RELEASE, $stockable); }