Debian Codegraph @

lib/3rdParty/composer/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.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 UnknownGetterException extends BaseInvalidArgumentException implements InvalidArgumentException
20 {
21 /**
22 * The getter.
23 *
24 * @var string
25 */
26 protected $getter;
27
28 /**
29 * Constructor.
30 *
31 * @param string $getter getter name
32 * @param int $code
33 * @param Throwable|null $previous
34 */
35 public function __construct($getter, $code = 0, ?Throwable $previous = null)
36 {
37 $this->getter = $getter;
38
39 parent::__construct("Unknown getter '$getter'", $code, $previous);
40 }
41
42 /**
43 * Get the getter.
44 *
45 * @return string
46 */
47 public function getGetter(): string
48 {
49 return $this->getter;
50 }
51 }