Debian Codegraph @

lib/3rdParty/composer/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php

raw symbols SCIP
1 <?php
2
3 declare(strict_types=1);
4
5 /**
6 * This file is part of the Carbon package.
7 *
8 * (c) Brian Nesbitt <[email protected]>
9 *
10 * For the full copyright and license information, please view the LICENSE
11 * file that was distributed with this source code.
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 * The invalid field.
23 *
24 * @var string
25 */
26 private $field;
27
28 /**
29 * The invalid value.
30 *
31 * @var mixed
32 */
33 private $value;
34
35 /**
36 * Constructor.
37 *
38 * @param string $field
39 * @param mixed $value
40 * @param int $code
41 * @param Throwable|null $previous
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 * Get the invalid field.
52 *
53 * @return string
54 */
55 public function getField()
56 {
57 return $this->field;
58 }
59
60 /**
61 * Get the invalid value.
62 *
63 * @return mixed
64 */
65 public function getValue()
66 {
67 return $this->value;
68 }
69 }