hirethunk / verbs

Verbs is an event sourcing package for PHP artisans
https://verbs.thunk.dev
MIT License
412 stars 32 forks source link

[Bug]: When event data array doesn't contain the index 0 error is thrown #157

Closed rzv-me closed 1 month ago

rzv-me commented 1 month ago

What happened?

Exception Undefined array key 0 thrown in listener https://github.com/hirethunk/verbs/blob/ff0ef03b4119879d227642194ca14488c0204362/src/VerbsServiceProvider.php#L162 because some packages when dispatching event don't have a 0 item in the data array eg.: https://github.com/VentureCraft/revisionable/blob/f2175b59041de6610d1586db186d0a0a782bd74e/src/Venturecraft/Revisionable/RevisionableTrait.php#L214C17-L214C108

How to reproduce the bug

Package Version

0.5.1

PHP Version

8.2

Laravel Version

10.48.12

Which operating systems does with happen with?

macOS, Linux

Notes

No response

rzv-me commented 4 weeks ago

Hi @inxilpro,

just wanted to let you know that the fix for this from PR #158 is not included in the releases 0.5.2 nor 0.6.0, even though it is present on the main branch.

is there any way we can tag a release that includes this bugfix?

thanks