Skip to content
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

Warning and unexpected behaviour after rejecting a transaction #77

Closed
titomiguelcosta opened this issue Dec 11, 2014 · 6 comments
Closed

Comments

@titomiguelcosta
Copy link

Only today I came across this library, after a few hours of study and running a few examples, I came across the following:

  • Warning if I do not pass a guard option when defining a transition: PHP Notice: Undefined index: guard in vendor/yohang/finite/src/Finite/Loader/ArrayLoader.php on line 109. I did not see any reference of this property in the examples.
  • I was expecting that by calling the method reject() on the TransitionEvent, this would abort the transition, but not the case, it seems it has no impact. The method apply() on StateMachine, after dispatching the pre events, call process() on the Transition, but that method has an empty body, it does not return any value, but still, we use that as the return value of the apply(). Is this by design, are we suppose to create/extend the Transition class and implement our logic in the process method()?
@HectorOrdonez
Copy link

The guard was optional till this PR: #73

I am currently researching about this because I was implementing this state machine without guards and now it seems like it must be included.

@matteosister
Copy link

this problem is solved on master...is related to the OptionResolver component version 2.6

ahurt2000 added a commit to ahurt2000/Finite that referenced this issue Feb 24, 2015
The  [issue 77] (yohang#77) explain the problem. I suggest this change to resolve it.
@Wesseldr
Copy link

Can someone please give a hint to me? I'm hitting this error as well but I can't figure out what this "guard" thing is that blows up.
Do I just need to use the current master or is the release 1.0.3 also a fixed release?
I'm using symfony2.6.*

@Wesseldr
Copy link

Got a step forward using this:

"yohang/finite": "dev-master",
"alom/graphviz": "~1.0.1",
"kphoen/doctrine-state-machine-bundle": "dev-master",

Now the guard is silent :-)

@yohang
Copy link
Owner

yohang commented Nov 30, 2015

1.0 won't use Symfony 2.6, but I'll release 1.1.0 this week. Can you confirm that the problem is gone with the current master (1.1) ?

@yohang
Copy link
Owner

yohang commented Nov 30, 2015

Fixed in #76

@yohang yohang closed this as completed Nov 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants