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 RuntimeException as BaseRuntimeException;
15
use Throwable;
16
 
17
class ImmutableException extends BaseRuntimeException implements RuntimeException
18
{
19
    /**
20
     * The value.
21
     *
22
     * @var string
23
     */
24
    protected $value;
25
 
26
    /**
27
     * Constructor.
28
     *
29
     * @param string         $value    the immutable type/value
30
     * @param int            $code
31
     * @param Throwable|null $previous
32
     */
33
    public function __construct($value, $code = 0, Throwable $previous = null)
34
    {
35
        $this->value = $value;
36
        parent::__construct("$value is immutable.", $code, $previous);
37
    }
38
 
39
    /**
40
     * Get the value.
41
     *
42
     * @return string
43
     */
44
    public function getValue(): string
45
    {
46
        return $this->value;
47
    }
48
}