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
Use the new State Machine abstraction #15738
Conversation
jakubtobiasz
commented
Jan 17, 2024
Q | A |
---|---|
Branch? | 1.13 |
Bug fix? | no |
New feature? | kinda |
BC breaks? | no |
Deprecations? | no |
Related tickets | based on the #15729 |
License | MIT |
Bunnyshell Preview Environment deletedAvailable commands:
|
f28391f
to
eebd7f8
Compare
11421b5
to
d4db541
Compare
8c3fc7a
to
b1a1d7e
Compare
e54bfc4
to
ab21735
Compare
/** | ||
* @throws StateMachineExecutionException | ||
*/ | ||
public function getTransitionFromState(object $subject, string $graphName, string $fromState): ?string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public before private 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's discussable. I've talked with Janek about it, and we agreed we should all talk about it. I'm in favor of leaving it as-is, and eventually change it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll discuss it further at a later date, either way, if we'd want to revert it and keep the public => protected => private order that'll be fixed along with adding an ecs rule.
src/Sylius/Component/Core/Payment/Provider/OrderPaymentProvider.php
Outdated
Show resolved
Hide resolved
src/Sylius/Abstraction/StateMachine/src/SymfonyWorkflowAdapter.php
Outdated
Show resolved
Hide resolved
6daaeb2
to
fb5e73c
Compare
Thank you, @jakubtobiasz! |
This PR was merged into the 1.13 branch. Discussion ---------- | Q | A | |-----------------|--------------------------------------------------------------| | Branch? | 1.13 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | #15738 | License | MIT The `apply` method in the sm.callback.cascade_transition class (\SM\Callback\CascadeTransitionCallback) has a `$soft` parameter, which defaults to true. When `$soft` is set to true, the method first checks if the transition can be applied without throwing an exception. So I have added checking to symfony workflow events. Commits ------- Remove missed sm.factory usages [Behat] Replace sm.factory to sylius_abstraction.state_machine [Workflow] Add check to verify if a transaction can be applied [Behat] Change workflow exception message [Api] Add OrderCancellationFailedException class [Api] Add PaymentCompletionFailedException class [Api] Add ProductReviewAcceptanceFailedException class [Api] Add ProductReviewRejectionFailedException class [StateMachine] Organize the interfaces in CompositeStateMachine class [Api] Remove unnecessary code [StateMachine] Use WorkflowExceptionInterface instead of InvalidArgumentException [StateMachine] Refactor CompositeStateMachine to use inline commands [Api] Add semi-generic exception StateMachineTransitionFailedException [Core][Workflow] Rename names of test functions