Task: Implement the DomainEvent class with dynamic property access
What to implement
Create a PHP class Vanio\DoctrineDomainEvents\DomainEvent that represents a domain event.
The class must:
Accept a name (string) and an optional associative array of properties in the constructor.
Expose a method name(): string that returns the event name.
Allow access to defined properties as dynamic properties, e.g. $event->foo returns the value from the properties array if 'foo' exists.
If a non-existent property is accessed (e.g., $event->bar when 'bar' is not in the properties array), throw a RuntimeException with the exact message:
Property "bar" does not exist on domain event "NAME".
where NAME is the value returned by name().
Ensure that properties with null values are accessible and return null.
Only implement what is necessary for the tests; no extra public methods or behavior required.
File placement
Place the implementation at: app/Vanio/DoctrineDomainEvents/DomainEvent.php