| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* This file is part of the Carbon package. |
| 5 |
* |
| 6 |
* (c) Brian Nesbitt <[email protected]> |
| 7 |
* |
| 8 |
* For the full copyright and license information, please view the LICENSE |
| 9 |
* file that was distributed with this source code. |
| 10 |
*/ |
| 11 |
namespace Metricool\Vendor\Carbon\Exceptions; |
| 12 |
|
| 13 |
use RuntimeException as BaseRuntimeException; |
| 14 |
use Throwable; |
| 15 |
class ImmutableException extends BaseRuntimeException implements RuntimeException |
| 16 |
{ |
| 17 |
/** |
| 18 |
* The value. |
| 19 |
* |
| 20 |
* @var string |
| 21 |
*/ |
| 22 |
protected $value; |
| 23 |
/** |
| 24 |
* Constructor. |
| 25 |
* |
| 26 |
* @param string $value the immutable type/value |
| 27 |
* @param int $code |
| 28 |
* @param Throwable|null $previous |
| 29 |
*/ |
| 30 |
public function __construct($value, $code = 0, ?Throwable $previous = null) |
| 31 |
{ |
| 32 |
$this->value = $value; |
| 33 |
parent::__construct("{$value} is immutable.", $code, $previous); |
| 34 |
} |
| 35 |
/** |
| 36 |
* Get the value. |
| 37 |
* |
| 38 |
* @return string |
| 39 |
*/ |
| 40 |
public function getValue(): string |
| 41 |
{ |
| 42 |
return $this->value; |
| 43 |
} |
| 44 |
} |
| 45 |
|