You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd suggest that event validation has a callable to be able to fail a validation rather than the boolean method, although both of them can be available.
e.g.
class UserDroppedGoal extends Event
{
publicfunction validate(UserState$state, \Closure$fail): void
{
if (true) {
$fail('The state isn't in the right mindset to run today, try again tomorrow?');
return;
}
}
}
Or make it possible to return a string for the error:
class UserDroppedGoal extends Event
{
publicfunction validate(UserState$state, \Closure$fail): string|true
{
if (true) {
return'The state isn't in the right mindset to run today, try again tomorrow?';
}
}
}
I'd be happy to work on this if it's wanted and I can find the time.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'd suggest that event validation has a callable to be able to fail a validation rather than the boolean method, although both of them can be available.
e.g.
Or make it possible to return a string for the error:
I'd be happy to work on this if it's wanted and I can find the time.
Beta Was this translation helpful? Give feedback.
All reactions