Debian Codegraph @

lib/3rdParty/composer/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.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 Throwable;
17
18 class UnitNotConfiguredException extends UnitException
19 {
20 /**
21 * The unit.
22 *
23 * @var string
24 */
25 protected $unit;
26
27 /**
28 * Constructor.
29 *
30 * @param string $unit
31 * @param int $code
32 * @param Throwable|null $previous
33 */
34 public function __construct($unit, $code = 0, ?Throwable $previous = null)
35 {
36 $this->unit = $unit;
37
38 parent::__construct("Unit $unit have no configuration to get total from other units.", $code, $previous);
39 }
40
41 /**
42 * Get the unit.
43 *
44 * @return string
45 */
46 public function getUnit(): string
47 {
48 return $this->unit;
49 }
50 }