Debian Codegraph @

lib/3rdParty/composer/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.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 BadMethodCallException as BaseBadMethodCallException;
17 use Throwable;
18
19 class UnknownMethodException extends BaseBadMethodCallException implements BadMethodCallException
20 {
21 /**
22 * The method.
23 *
24 * @var string
25 */
26 protected $method;
27
28 /**
29 * Constructor.
30 *
31 * @param string $method
32 * @param int $code
33 * @param Throwable|null $previous
34 */
35 public function __construct($method, $code = 0, ?Throwable $previous = null)
36 {
37 $this->method = $method;
38
39 parent::__construct("Method $method does not exist.", $code, $previous);
40 }
41
42 /**
43 * Get the method.
44 *
45 * @return string
46 */
47 public function getMethod(): string
48 {
49 return $this->method;
50 }
51 }