ldc-enum/src/Exceptions/UnknownEnumProperty.php

22 lines
433 B
PHP
Raw Normal View History

2021-03-01 07:55:10 +01:00
<?php
namespace Kwaadpepper\Enum\Exceptions;
use Exception;
2021-09-11 11:11:21 +02:00
/**
* Is thrown when accessing other propety than
* label or value on a enumeration.
*/
2021-03-01 07:55:10 +01:00
class UnknownEnumProperty extends Exception
{
2021-09-11 11:11:21 +02:00
protected $message;
public function __construct(string $attribute)
{
$this->message = "Unknown attribute $attribute, enumeration only have propeties `label` and `value`.";
parent::__construct();
}
2021-03-01 07:55:10 +01:00
}