Code Duplication    Length = 8-10 lines in 2 locations

lib/PhpFlo/Fbp/FbpParser.php 2 locations

@@ 153-160 (lines=8) @@
150
151
            //define states
152
            switch (true) {
153
                case !empty($step[self::DATA_LABEL]) && ($hasInport && $hasOutport):
154
                    // initializer + inport
155
                    $nextSrc = $resolved;
156
                    $step[self::TARGET_LABEL] = $this->addPort($resolved, self::INPORT_LABEL);
157
                    // multi def oneliner initializer resolved
158
                    array_push($this->definition[self::INITIALIZERS_LABEL], $step);
159
                    $step = [];
160
                    break;
161
                case !empty($nextSrc) && ($hasInport && $hasOutport):
162
                    // if there was an initializer, we get a full touple with this iteration
163
                    $step = [
@@ 171-180 (lines=10) @@
168
                    array_push($subset, $step);
169
                    $step = [];
170
                    break;
171
                case $hasInport && $hasOutport:
172
                    // tgt + multi def
173
                    $nextSrc = $resolved;
174
                    $step[self::TARGET_LABEL] = $this->addPort($resolved, self::INPORT_LABEL);
175
                    // check if we've already got the touple ready
176
                    if (!empty($step[self::SOURCE_LABEL])) {
177
                        array_push($subset, $step);
178
                        $step = [];
179
                    }
180
                    break;
181
                case $hasInport && $nextSrc:
182
                    // use previous OUT as src to fill touple
183
                    $step[self::SOURCE_LABEL] = $this->addPort($nextSrc, self::OUTPORT_LABEL);