Open nikophil opened 4 days ago
Hello,
would you accept a PR which would add a concept of "priority" between hooks like Before, After...?
Before
After
This would allow to control the order of execution of these hooks, mainly useful when used along with traits:
trait SomeTraitWithHook { #[Before] protected function someBeforeHook(): void { // do something } } trait SomeOtherTraitWithHook { #[Before(priority: 5)] protected function someOtherBeforeHook(): void { // will be executed before `SomeTraitWithHook::someBeforeHook` } }
priority should be any integer (even negative ones), and it would default to 0.
priority
0
thanks for your answer on this.
Yes, I am open for that.
Hello,
would you accept a PR which would add a concept of "priority" between hooks like
Before
,After
...?This would allow to control the order of execution of these hooks, mainly useful when used along with traits:
priority
should be any integer (even negative ones), and it would default to0
.thanks for your answer on this.