Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 protected function assertCorrectLimits(Range $range)
 {
     $this->assertCorrectLimitType($range->min());
     $this->assertCorrectLimitType($range->max());
     $this->assertSameCurrencies();
 }
Ejemplo n.º 2
0
 /**
  * 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.'));
     }
 }