yohang / Finite

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

Refactored StateMachine to reduce complexity a bit #109

Closed RonRademaker closed 8 years ago

RonRademaker commented 8 years ago

Hi,

I refactored the events part of the StateMachine a bit to address part of #105

phillipsnick commented 8 years ago

Nice! Any reason the dispatchTransitionEvent is private over protected though?

I extend the StateMachine on one project to add some functionality.

RonRademaker commented 8 years ago

Making methods and properties private allows you to refactor or change things in the future without breaking backwards compatibility. Unless there's a use case that'd require making the method protected I'd say it's good practice to make anything (that is not part of the public API of course) private.

phillipsnick commented 8 years ago

Ah ok, thanks for the info :+1:

yohang commented 8 years ago

Seems good, thanks !