/** * {@inheritdoc} */ protected function assertCorrectLimits(Range $range) { $this->assertCorrectLimitType($range->min()); $this->assertCorrectLimitType($range->max()); $this->assertSameCurrencies(); }
/** * Check if given values can be limits for current range. * * @param Range $range * * @throws \DomainException */ protected function assertCorrectLimits(Range $range) { $this->assertCorrectLimitType($range->min()); $this->assertCorrectLimitType($range->max()); if (null !== $range->min() && null !== $range->max() && $range->min() > $range->max()) { throw new \DomainException(sprintf('Lower limit cannot be greater than upper limit.')); } }