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
ParseErrorException.php
32 lines
| 1 | <?php |
| 2 | namespace MailPoetVendor\Carbon\Exceptions; |
| 3 | if (!defined('ABSPATH')) exit; |
| 4 | use InvalidArgumentException as BaseInvalidArgumentException; |
| 5 | use Throwable; |
| 6 | class ParseErrorException extends BaseInvalidArgumentException implements InvalidArgumentException |
| 7 | { |
| 8 | protected $expected; |
| 9 | protected $actual; |
| 10 | protected $help; |
| 11 | public function __construct($expected, $actual, $help = '', $code = 0,?Throwable $previous = null) |
| 12 | { |
| 13 | $this->expected = $expected; |
| 14 | $this->actual = $actual; |
| 15 | $this->help = $help; |
| 16 | $actual = $actual === '' ? 'data is missing' : "get '{$actual}'"; |
| 17 | parent::__construct(\trim("Format expected {$expected} but {$actual}\n{$help}"), $code, $previous); |
| 18 | } |
| 19 | public function getExpected() : string |
| 20 | { |
| 21 | return $this->expected; |
| 22 | } |
| 23 | public function getActual() : string |
| 24 | { |
| 25 | return $this->actual; |
| 26 | } |
| 27 | public function getHelp() : string |
| 28 | { |
| 29 | return $this->help; |
| 30 | } |
| 31 | } |
| 32 |