mirror of
https://github.com/archtechx/enums.git
synced 2025-12-14 00:04:03 +00:00
initial
This commit is contained in:
parent
f9fe9e5cab
commit
41b423da38
11 changed files with 146 additions and 91 deletions
16
src/Exceptions/UndefinedCaseError.php
Normal file
16
src/Exceptions/UndefinedCaseError.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ArchTech\Enums\Exceptions;
|
||||
|
||||
use Error;
|
||||
|
||||
class UndefinedCaseError extends Error
|
||||
{
|
||||
public function __construct(string $enum, string $case)
|
||||
{
|
||||
// Matches the error message of invalid Foo::BAR access
|
||||
parent::__construct("Undefined constant $enum::$case");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue