[core] show known properties when one is missing

This commit is contained in:
Shish 2024-02-11 18:36:46 +00:00
parent 4b8a6c6c43
commit 7a91833d22

View file

@ -131,7 +131,8 @@ class Image implements \ArrayAccess
{ {
assert(is_string($offset)); assert(is_string($offset));
if(!$this->offsetExists($offset)) { if(!$this->offsetExists($offset)) {
throw new \OutOfBoundsException("Undefined dynamic property: $offset"); $known = implode(", ", array_keys(static::$prop_types));
throw new \OutOfBoundsException("Undefined dynamic property: $offset (Known: $known)");
} }
return $this->dynamic_props[$offset] ?? null; return $this->dynamic_props[$offset] ?? null;
} }