@@ -85,20 +85,20 @@ discard block |
||
85 | 85 | $lastBranchIndex = $startContext->getBranchContext()->getIndex(); |
86 | 86 | $globalPassedVertexesMap = $startContext->getGlobalPassedVertexesMap(); |
87 | 87 | |
88 | - if($traverseMode === self::MODE_WIDE) { |
|
88 | + if ($traverseMode === self::MODE_WIDE) { |
|
89 | 89 | $contexts = new Queue([$startContext]); |
90 | 90 | } else { |
91 | 91 | $contexts = new Stack([$startContext]); |
92 | 92 | } |
93 | - while(count($contexts)) { |
|
93 | + while (count($contexts)) { |
|
94 | 94 | /** @var TraverseContextInterface $currentContext */ |
95 | 95 | $currentContext = $contexts->pop(); |
96 | 96 | $currentVertex = $currentContext->getVertex(); |
97 | 97 | $currentEdge = $currentContext->getEdge(); |
98 | 98 | |
99 | - if($filter->matchesHandleCondition($currentContext)) { |
|
99 | + if ($filter->matchesHandleCondition($currentContext)) { |
|
100 | 100 | $cmd = (yield $currentEdge => $currentContext); |
101 | - switch($cmd) { |
|
101 | + switch ($cmd) { |
|
102 | 102 | case static::STOP_BRANCH: |
103 | 103 | yield $currentEdge => $currentContext; |
104 | 104 | continue 2; |
@@ -113,9 +113,9 @@ discard block |
||
113 | 113 | |
114 | 114 | $nextVertexes = $this->getNextVertexes($currentVertex, $filter->getPassCondition($currentContext)); |
115 | 115 | $i = 0; |
116 | - foreach($nextVertexes as $edge => $vertex) { |
|
116 | + foreach ($nextVertexes as $edge => $vertex) { |
|
117 | 117 | $currentBranchContext = $currentContext->getBranchContext(); |
118 | - if(count($nextVertexes) > 1 && $i > 0) { |
|
118 | + if (count($nextVertexes) > 1 && $i > 0) { |
|
119 | 119 | $nextBranchContext = $this->createBranchContext( |
120 | 120 | ++$lastBranchIndex, |
121 | 121 | $currentBranchContext->getIndex(), |
@@ -31,9 +31,9 @@ discard block |
||
31 | 31 | { |
32 | 32 | $passCondition = $this->getDefaultPassCondition($context); |
33 | 33 | |
34 | - if($this->needToPreventLoopPass($context)) { |
|
34 | + if ($this->needToPreventLoopPass($context)) { |
|
35 | 35 | $passCondition = (clone $passCondition)->onlyVertexTypes([]); |
36 | - } elseif($this->needToCheckReturnBackPass() && ($prevVertex = $context->getPrevVertex()) !== null) { |
|
36 | + } elseif ($this->needToCheckReturnBackPass() && ($prevVertex = $context->getPrevVertex()) !== null) { |
|
37 | 37 | $passCondition = (clone $passCondition)->excludeVertexIds([$prevVertex->getId()]); |
38 | 38 | } |
39 | 39 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | $handleCondition = $this->getDefaultHandleCondition($context); |
50 | 50 | |
51 | - if($this->needToPreventLoopHandle($context) || $this->needToPreventRepeatHandle($context)) { |
|
51 | + if ($this->needToPreventLoopHandle($context) || $this->needToPreventRepeatHandle($context)) { |
|
52 | 52 | $handleCondition = (clone $handleCondition)->onlyVertexTypes([]); |
53 | 53 | } |
54 | 54 |