Conditions | 5 |
Paths | 4 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function resolve(SubscriptionInterface $subscription) |
||
33 | { |
||
34 | $stateMachine = $this->stateMachineFactory->get($subscription, SubscriptionTransitions::GRAPH); |
||
35 | |||
36 | if ($this->canSubscriptionBeFulfilled($subscription) && $stateMachine->can(SubscriptionTransitions::TRANSITION_FULFILL)) { |
||
37 | $stateMachine->apply(SubscriptionTransitions::TRANSITION_FULFILL); |
||
38 | } |
||
39 | |||
40 | if ($this->canSubscriptionBeCancelled($subscription) && $stateMachine->can(SubscriptionTransitions::TRANSITION_CANCEL)) { |
||
41 | $stateMachine->apply(SubscriptionTransitions::TRANSITION_CANCEL); |
||
42 | } |
||
43 | } |
||
44 | |||
65 |