public static function notNull($value, $message = '')
{
if (null === $value) {
static::reportInvalidArgument($message ?: 'Expected a value other than null.');
}
}
/** * {@inheritdoc} */ public function calculate(ProductVariantInterface $productVariant, array $context) { Assert::keyExists($context, 'channel'); $channelPricing = $productVariant->getChannelPricingForChannel($context['channel']); Assert::notNull($channelPricing); return $channelPricing->getPrice(); }