| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
namespace Carbon\Exceptions; |
| 15 |
|
| 16 |
use InvalidArgumentException as BaseInvalidArgumentException; |
| 17 |
use Throwable; |
| 18 |
|
| 19 |
class InvalidDateException extends BaseInvalidArgumentException implements InvalidArgumentException |
| 20 |
{ |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
private $field; |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
private $value; |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
public function __construct($field, $value, $code = 0, ?Throwable $previous = null) |
| 44 |
{ |
| 45 |
$this->field = $field; |
| 46 |
$this->value = $value; |
| 47 |
parent::__construct($field.' : '.$value.' is not a valid value.', $code, $previous); |
| 48 |
} |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
public function getField() |
| 56 |
{ |
| 57 |
return $this->field; |
| 58 |
} |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
public function getValue() |
| 66 |
{ |
| 67 |
return $this->value; |
| 68 |
} |
| 69 |
} |