Conditions | 19 |
Paths | 28 |
Total Lines | 42 |
Code Lines | 26 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
48 | protected function eventNotificationsCompleted(CoreExecution $execution): void |
||
49 | { |
||
50 | $activity = $execution->getActivity(); |
||
51 | |||
52 | if ( |
||
53 | $execution->isScope() |
||
54 | && ($this->executesNonScopeActivity($execution) || $this->isAsyncBeforeActivity($execution)) |
||
55 | && !CompensationBehavior::executesNonScopeCompensationHandler($execution) |
||
56 | ) { |
||
57 | $execution->removeAllTasks(); |
||
58 | // case this is a scope execution and the activity is not a scope |
||
59 | $execution->leaveActivityInstance(); |
||
60 | $execution->setActivity(getFlowScopeActivity($activity)); |
||
|
|||
61 | $execution->performOperation(self::deleteCascadeFireActivityEnd()); |
||
62 | } else { |
||
63 | if ($execution->isScope()) { |
||
64 | if ($execution instanceof ExecutionEntity && !$execution->isProcessInstanceExecution() && $execution->isCanceled()) { |
||
65 | // execution was canceled and output mapping for activity is marked as skippable |
||
66 | $execution->setSkipIoMappings($execution->isSkipIoMappings() || $execution->getProcessEngine()->getProcessEngineConfiguration()->isSkipOutputMappingOnCanceledActivities()); |
||
67 | } |
||
68 | $execution->destroy(); |
||
69 | } |
||
70 | |||
71 | // remove this execution and its concurrent parent (if exists) |
||
72 | $execution->remove(); |
||
73 | |||
74 | $continueRemoval = !$execution->isDeleteRoot(); |
||
75 | |||
76 | if ($continueRemoval) { |
||
77 | $propagatingExecution = $execution->getParent(); |
||
78 | if ($propagatingExecution !== null && !$propagatingExecution->isScope() && !$propagatingExecution->hasChildren()) { |
||
79 | $propagatingExecution->remove(); |
||
80 | $continueRemoval = !$propagatingExecution->isDeleteRoot(); |
||
81 | $propagatingExecution = $propagatingExecution->getParent(); |
||
82 | } |
||
83 | |||
84 | if ($continueRemoval) { |
||
85 | if ($propagatingExecution !== null) { |
||
86 | // continue deletion with the next scope execution |
||
87 | // set activity on parent in case the parent is an inactive scope execution and activity has been set to 'null'. |
||
88 | if ($propagatingExecution->getActivity() === null && $activity !== null && $activity->getFlowScope() !== null) { |
||
89 | $propagatingExecution->setActivity($this->getFlowScopeActivity($activity)); |
||
90 | } |
||
123 |