| Conditions | 8 | 
| Paths | 14 | 
| Total Lines | 28 | 
| Code Lines | 20 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php  | 
            ||
| 15 | public static function handleChildRemovalInScope(ExecutionEntity $removedExecution): void  | 
            ||
| 16 |     { | 
            ||
| 17 | $activity = $removedExecution->getActivity();  | 
            ||
| 18 |         if ($activity === null) { | 
            ||
| 19 |             if ($removedExecution->getSuperExecution() !== null) { | 
            ||
| 20 | $removedExecution = $removedExecution->getSuperExecution();  | 
            ||
| 21 | $activity = $removedExecution->getActivity();  | 
            ||
| 22 |                 if ($activity == null) { | 
            ||
| 23 | return;  | 
            ||
| 24 | }  | 
            ||
| 25 |             } else { | 
            ||
| 26 | return;  | 
            ||
| 27 | }  | 
            ||
| 28 | }  | 
            ||
| 29 | $flowScope = $activity->getFlowScope();  | 
            ||
| 30 | |||
| 31 | $scopeExecution = $removedExecution->getParentScopeExecution(false);  | 
            ||
| 32 | $executionInParentScope = $removedExecution->isConcurrent() ? $removedExecution : $removedExecution->getParent();  | 
            ||
| 33 | |||
| 34 |         if ($flowScope->getActivityBehavior() != null && $flowScope->getActivityBehavior() instanceof ModificationObserverBehaviorInterface) { | 
            ||
| 35 | // let child removal be handled by the scope itself  | 
            ||
| 36 | $behavior = $flowScope->getActivityBehavior();  | 
            ||
| 37 | $behavior->destroyInnerInstance($executionInParentScope);  | 
            ||
| 
                                                                                                    
                        
                         | 
                |||
| 38 |         } else { | 
            ||
| 39 |             if ($executionInParentScope->isConcurrent()) { | 
            ||
| 40 | $executionInParentScope->remove();  | 
            ||
| 41 | $scopeExecution->tryPruneLastConcurrentChild();  | 
            ||
| 42 | $scopeExecution->forceUpdate();  | 
            ||
| 43 | }  | 
            ||
| 47 |