isNegative()) { throw new \DomainException('Product price cannot be negative'); } if ($discountedPrice->isNegative()) { throw new \DomainException('Product discounted price cannot be negative'); } if ($priceKgTtc->isNegative()) { throw new \DomainException('Price per kg TTC cannot be negative'); } if ($discountedPrice->greaterThan($price)) { throw new \DomainException('Product discounted price cannot be greater than original price'); } if (! $priceKgTtc->isPositive()) { throw new \DomainException('Price per kg TTC has to be positive'); } } }