KeyNotAllowed
extends InvalidArgumentException
in package
implements
HasCategory, HasOffset
FinalYes
A map key that DXN.md §1.6 does not allow, with its `key/not-allowed` category.
Table of Contents
Interfaces
- HasCategory
- Implemented by any exception that knows its DXN.md §5 category -- `syntax`, `binary`, `encode/unsupported`, ... -- so {@see DXNError::wrap()} can carry it across without knowing every concrete exception class, the way {@see HasOffset} carries an offset.
- HasOffset
- Implemented by any exception that can report a byte/character offset into the source it failed on (lexer/parser errors) -- lets {@see DXNError::wrap()} preserve that offset without needing to know about every concrete exception class in the text/binary pipelines.
Properties
- $at : int|null
Methods
- category() : string
- The category, or null for an exception that has none.
- of() : self
- Refuses `$key`, named as DXN writes it (`[1] cannot be a map key`), as the reference names it, or as PHP does when it has no DXN form.
- offset() : int|null
- placedAt() : self
- This refusal, placed at `$offset`, where the key was written -- the first place found wins.
Properties
$at
private
int|null
$at
= null
Methods
category()
The category, or null for an exception that has none.
public
category() : string
Return values
stringof()
Refuses `$key`, named as DXN writes it (`[1] cannot be a map key`), as the reference names it, or as PHP does when it has no DXN form.
public
static of(mixed $key) : self
Parameters
- $key : mixed
Return values
selfoffset()
public
offset() : int|null
Return values
int|nullplacedAt()
This refusal, placed at `$offset`, where the key was written -- the first place found wins.
public
placedAt(int $offset) : self
Parameters
- $offset : int