Code Duplication    Length = 8-10 lines in 2 locations

lib/PhpFlo/Fbp/FbpParser.php 2 locations

@@ 138-145 (lines=8) @@
135
136
            //define states
137
            switch (true) {
138
                case !empty($step[self::DATA_LABEL]) && ($hasInport && $hasOutport):
139
                    // initializer + inport
140
                    $nextSrc = $resolved;
141
                    $step[self::TARGET_LABEL] = $this->addPort($resolved, self::INPORT_LABEL);
142
                    // multi def oneliner initializer resolved
143
                    array_push($this->definition[self::INITIALIZERS_LABEL], $step);
144
                    $step = [];
145
                    break;
146
                case !empty($nextSrc) && ($hasInport && $hasOutport):
147
                    // if there was an initializer, we get a full touple with this iteration
148
                    $step = [
@@ 156-165 (lines=10) @@
153
                    array_push($subset, $step);
154
                    $step = [];
155
                    break;
156
                case $hasInport && $hasOutport:
157
                    // tgt + multi def
158
                    $nextSrc = $resolved;
159
                    $step[self::TARGET_LABEL] = $this->addPort($resolved, self::INPORT_LABEL);
160
                    // check if we've already got the touple ready
161
                    if (!empty($step[self::SOURCE_LABEL])) {
162
                        array_push($subset, $step);
163
                        $step = [];
164
                    }
165
                    break;
166
                case $hasInport && $nextSrc:
167
                    // use orevious OUT as src to fill touple
168
                    $step[self::SOURCE_LABEL] = $this->addPort($nextSrc, self::OUTPORT_LABEL);