23 lines
773 B
PHP
23 lines
773 B
PHP
|
<?php
|
||
|
|
||
|
namespace Nest\Model\Exceptions;
|
||
|
|
||
|
use Throwable;
|
||
|
|
||
|
/**
|
||
|
* Thrown when a property with an unhandled type has been provided.
|
||
|
*/
|
||
|
class UnhandledPropertyTypeException extends ModelException
|
||
|
{
|
||
|
/**
|
||
|
* @param string $propertyName Name of the provided property.
|
||
|
* @param class-string $propertyType Class name of the unhandled property type.
|
||
|
* @param int $code [optional] The Exception code.
|
||
|
* @param null|Throwable $previous [optional] The previous throwable used for the exception chaining.
|
||
|
*/
|
||
|
public function __construct(public readonly string $propertyName, public readonly string $propertyType, int $code = 0, ?Throwable $previous = null)
|
||
|
{
|
||
|
parent::__construct("Unhandled property $this->propertyName of type $this->propertyType.", $code, $previous);
|
||
|
}
|
||
|
}
|