Files
apimacro/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php

50 lines
1.0 KiB
PHP
Raw Normal View History

2024-05-07 12:17:25 +02:00
<?php
/**
* This file is part of the Carbon package.
*
* (c) Brian Nesbitt <brian@nesbot.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon\Exceptions;
use InvalidArgumentException as BaseInvalidArgumentException;
2024-05-17 12:24:19 +00:00
use Throwable;
2024-05-07 12:17:25 +02:00
class UnknownGetterException extends BaseInvalidArgumentException implements InvalidArgumentException
{
2024-05-17 12:24:19 +00:00
/**
* The getter.
*
* @var string
*/
protected $getter;
2024-05-07 12:17:25 +02:00
/**
* Constructor.
*
2024-05-17 12:24:19 +00:00
* @param string $getter getter name
2024-05-07 12:17:25 +02:00
* @param int $code
2024-05-17 12:24:19 +00:00
* @param Throwable|null $previous
*/
public function __construct($getter, $code = 0, Throwable $previous = null)
{
$this->getter = $getter;
parent::__construct("Unknown getter '$getter'", $code, $previous);
}
/**
* Get the getter.
*
* @return string
2024-05-07 12:17:25 +02:00
*/
2024-05-17 12:24:19 +00:00
public function getGetter(): string
2024-05-07 12:17:25 +02:00
{
2024-05-17 12:24:19 +00:00
return $this->getter;
2024-05-07 12:17:25 +02:00
}
}