Code Duplication    Length = 8-10 lines in 2 locations

lib/PhpFlo/Fbp/FbpParser.php 2 locations

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