yohang / Finite

A Simple PHP Finite State Machine
http://yohan.giarel.li/Finite
MIT License
1.31k stars 188 forks source link

to reject the event #83

Open ahurt2000 opened 9 years ago

ahurt2000 commented 9 years ago

The issue 77 explain the problem. I suggest this change to resolve it.

hacfi commented 9 years ago

@ahurt2000 Do we really want a StateException if an event rejects the transition?

ahurt2000 commented 9 years ago

hum good question! may is better a TransitionException

ahurt2000 commented 9 years ago

Well, there's another way to approach it ignoring the event status as before. But then it makes sense that the event is rejected?

hacfi commented 9 years ago

I’m :+1: for this PR..just not sure whether to throw an Exception or fail silently (return;)

hacfi commented 9 years ago

Well..failing silently is not a good idea - nevermind.

yohang commented 8 years ago

Hum, sorry for taking this so late, but does it makes sense to reject a pre transition event ?

I think the real problem comes from the current implementation, that allow that. In fact, we can reject a post transition event…

2.0 version will probably split TestTransition and ApplyTransition events.