laravel-event-sourcing icon indicating copy to clipboard operation
laravel-event-sourcing copied to clipboard

Deprecation notice: $firedFromAggregateRoot is deprecated

Open ahoiroman opened this issue 1 year ago • 1 comments

Using PHP 8.2, I am getting this deprecation notice, if I set 'dispatch_events_from_aggregate_roots' => true,:

DEPRECATED Creation of dynamic property ... $firedFromAggregateRoot is deprecated in vendor/spatie/laravel-event-sourcing/src/StoredEvents/StoredEvent.php on line 68.

Should be possible to allow dynamic props or define them?

ahoiroman avatar Aug 25 '23 14:08 ahoiroman

Hmm I'm not sure we can do this without a breaking change, so might have to live with it until our next major version… The warning is annoying but everything still works until PHP 9 when dynamic properties will be removed entirely.

If anyone has an idea how we can work around this in a non-breaking way, ideas welcome!

sebastiandedeyne avatar Nov 29 '23 09:11 sebastiandedeyne

@sebastiandedeyne can this not be solved using an #[\AllowDynamicProperties] attribute?

inmanturbo avatar Mar 12 '24 16:03 inmanturbo