Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
/**
4
 * This file is part of the Carbon package.
5
 *
6
 * (c) Brian Nesbitt <brian@nesbot.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
 
12
namespace Carbon\Exceptions;
13
 
14
use InvalidArgumentException as BaseInvalidArgumentException;
15
use Throwable;
16
 
17
class InvalidDateException extends BaseInvalidArgumentException implements InvalidArgumentException
18
{
19
    /**
20
     * The invalid field.
21
     *
22
     * @var string
23
     */
24
    private $field;
25
 
26
    /**
27
     * The invalid value.
28
     *
29
     * @var mixed
30
     */
31
    private $value;
32
 
33
    /**
34
     * Constructor.
35
     *
36
     * @param string         $field
37
     * @param mixed          $value
38
     * @param int            $code
39
     * @param Throwable|null $previous
40
     */
41
    public function __construct($field, $value, $code = 0, Throwable $previous = null)
42
    {
43
        $this->field = $field;
44
        $this->value = $value;
45
        parent::__construct($field.' : '.$value.' is not a valid value.', $code, $previous);
46
    }
47
 
48
    /**
49
     * Get the invalid field.
50
     *
51
     * @return string
52
     */
53
    public function getField()
54
    {
55
        return $this->field;
56
    }
57
 
58
    /**
59
     * Get the invalid value.
60
     *
61
     * @return mixed
62
     */
63
    public function getValue()
64
    {
65
        return $this->value;
66
    }
67
}