-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use dedicated event eventArgs #2649
use dedicated event eventArgs #2649
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2649 +/- ##
==========================================
+ Coverage 79.27% 79.40% +0.13%
==========================================
Files 162 162
Lines 8467 8494 +27
==========================================
+ Hits 6712 6745 +33
+ Misses 1755 1749 -6 ☔ View full report in Codecov by Sentry. |
0fad774
to
ff14977
Compare
After this change, looks like The problem I see is that we would still triggering deprecations when creating the ORM event, but I don't know if that's avoidable (given that we should still extend from the ORM |
I moved the i also deprecated the function i'm not sure if the deprecations triggered at |
af2dcc4
to
c8f4639
Compare
I've rebased since there were some conflicts with the latest changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left some comments, please add some tests.
Updated: I've made those changes in a new commit, tests still need to be added.
96a2450
to
9e3c725
Compare
i've updated tests, let me know if i'm missing something |
I wanted to check if we can somehow avoid the First of all, check with And to finally remove the deprecation... I was thinking about creating That would create a BC break for someone with a listener typehinted with If the listener is not typehinted with These are some thoughts that I haven't tried and I don't know if that would work. |
i don't get what deprecations should be triggered inside the methods, can you provide an example ?
i think it should work but it's gonna get a little more complex to handle cases where there are multiple listeners on the same event |
e27f8bf
to
88ac2fa
Compare
@mbabker what about this? this is similar to #2725 and maintain a BC layer. When not all the listeners have type-hinted the new event class, it dispatches the old event. Given that this is Softdeleteable behavior I think it is important to try not break BC.
Sorry, I took another approach (adding a new commit), simplifying events and trying to maintain BC. |
88ac2fa
to
cb6be44
Compare
Looks fine to me. |
thanks @yassinefikri! |
* use dedicated eventArgs * fix workflow fails * fix * move functions to appropriate class * move functions to appropriate class * add changelog note * Move presoftdeletable methods * update tests to expect dedicated eventargs instances * Use Pre and Post event args when it is type-hinted --------- Co-authored-by: Fran Moreno <franmomu@gmail.com>
Resolves #2648