Code Duplication    Length = 21-21 lines in 2 locations

src/PhpSpreadsheet/Shared/JAMA/Matrix.php 2 locations

@@ 231-251 (lines=21) @@
228
                    return $R;
229
                    break;
230
                //A($i0...$iF); $CL = array of column indices
231
                case 'integer,integer,array':
232
                    list($i0, $iF, $CL) = $args;
233
                    if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) {
234
                        $m = $iF - $i0;
235
                    } else {
236
                        throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
237
                    }
238
                    if (count($CL) > 0) {
239
                        $n = count($CL);
240
                    } else {
241
                        throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
242
                    }
243
                    $R = new self($m, $n);
244
                    for ($i = $i0; $i < $iF; ++$i) {
245
                        for ($j = 0; $j < $n; ++$j) {
246
                            $R->set($i - $i0, $j, $this->A[$RL[$i]][$j]);
247
                        }
248
                    }
249
250
                    return $R;
251
                    break;
252
                //$RL = array of row indices
253
                case 'array,integer,integer':
254
                    list($RL, $j0, $jF) = $args;
@@ 253-273 (lines=21) @@
250
                    return $R;
251
                    break;
252
                //$RL = array of row indices
253
                case 'array,integer,integer':
254
                    list($RL, $j0, $jF) = $args;
255
                    if (count($RL) > 0) {
256
                        $m = count($RL);
257
                    } else {
258
                        throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
259
                    }
260
                    if (($jF >= $j0) && ($this->n >= $jF) && ($j0 >= 0)) {
261
                        $n = $jF - $j0;
262
                    } else {
263
                        throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
264
                    }
265
                    $R = new self($m, $n + 1);
266
                    for ($i = 0; $i < $m; ++$i) {
267
                        for ($j = $j0; $j <= $jF; ++$j) {
268
                            $R->set($i, $j - $j0, $this->A[$RL[$i]][$j]);
269
                        }
270
                    }
271
272
                    return $R;
273
                    break;
274
                default:
275
                    throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
276
                    break;