Code Duplication    Length = 8-10 lines in 2 locations

lib/PhpFlo/Fbp/FbpParser.php 2 locations

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