public static function true($value, $message = '')
{
if (true !== $value) {
static::reportInvalidArgument(sprintf($message ?: 'Expected a value to be true. Got: %s', static::valueToString($value)));
}
}
/** * {@inheritdoc} */ public function createForPromotion(PromotionInterface $promotion) { Assert::true($promotion->isCouponBased(), sprintf('Promotion with name %s is not coupon based.', $promotion->getName())); $coupon = $this->factory->createNew(); $coupon->setPromotion($promotion); return $coupon; }