BadComparisonUnitException.php
8 months ago
BadFluentConstructorException.php
8 months ago
BadFluentSetterException.php
8 months ago
BadMethodCallException.php
3 years ago
EndLessPeriodException.php
3 years ago
Exception.php
3 years ago
ImmutableException.php
8 months ago
InvalidArgumentException.php
3 years ago
InvalidCastException.php
3 years ago
InvalidDateException.php
8 months ago
InvalidFormatException.php
3 years ago
InvalidIntervalException.php
3 years ago
InvalidPeriodDateException.php
3 years ago
InvalidPeriodParameterException.php
3 years ago
InvalidTimeZoneException.php
3 years ago
InvalidTypeException.php
3 years ago
NotACarbonClassException.php
8 months ago
NotAPeriodException.php
3 years ago
NotLocaleAwareException.php
8 months ago
OutOfRangeException.php
8 months ago
ParseErrorException.php
8 months ago
RuntimeException.php
3 years ago
UnitException.php
3 years ago
UnitNotConfiguredException.php
8 months ago
UnknownGetterException.php
8 months ago
UnknownMethodException.php
8 months ago
UnknownSetterException.php
8 months ago
UnknownUnitException.php
8 months ago
UnreachableException.php
3 years ago
index.php
3 years ago
OutOfRangeException.php
39 lines
| 1 | <?php |
| 2 | namespace MailPoetVendor\Carbon\Exceptions; |
| 3 | if (!defined('ABSPATH')) exit; |
| 4 | use InvalidArgumentException as BaseInvalidArgumentException; |
| 5 | use Throwable; |
| 6 | // This will extends OutOfRangeException instead of InvalidArgumentException since 3.0.0 |
| 7 | // use OutOfRangeException as BaseOutOfRangeException; |
| 8 | class OutOfRangeException extends BaseInvalidArgumentException implements InvalidArgumentException |
| 9 | { |
| 10 | private $unit; |
| 11 | private $min; |
| 12 | private $max; |
| 13 | private $value; |
| 14 | public function __construct($unit, $min, $max, $value, $code = 0,?Throwable $previous = null) |
| 15 | { |
| 16 | $this->unit = $unit; |
| 17 | $this->min = $min; |
| 18 | $this->max = $max; |
| 19 | $this->value = $value; |
| 20 | parent::__construct("{$unit} must be between {$min} and {$max}, {$value} given", $code, $previous); |
| 21 | } |
| 22 | public function getMax() |
| 23 | { |
| 24 | return $this->max; |
| 25 | } |
| 26 | public function getMin() |
| 27 | { |
| 28 | return $this->min; |
| 29 | } |
| 30 | public function getUnit() |
| 31 | { |
| 32 | return $this->unit; |
| 33 | } |
| 34 | public function getValue() |
| 35 | { |
| 36 | return $this->value; |
| 37 | } |
| 38 | } |
| 39 |