$key
$key : string
Exception to be thrown when an unexpected file exists.
This exception is thrown when a file that is not anticipated to exist in the
filesystem is found. It extends the RuntimeException
and implements the
ExceptionInterface
to maintain a consistent exception handling approach
across the filesystem.
__construct(string $key, int $code, \Exception|null $previous = null) : mixed
Constructs a new `UnexpectedFileException` instance.
string | $key | The key (path) of the file that was unexpectedly found. |
int | $code | The exception code (default is 0). |
\Exception|null | $previous | Optional previous exception for chaining. |