Code Duplication    Length = 5-5 lines in 4 locations

src/PhpSpreadsheet/Calculation.php 4 locations

@@ 4199-4203 (lines=5) @@
4196
                //    Single cell in range
4197
                sscanf($aReferences[0], '%[A-Z]%d', $currentCol, $currentRow);
4198
                $cellValue = null;
4199
                if ($pSheet->cellExists($aReferences[0])) {
4200
                    $returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
4201
                } else {
4202
                    $returnValue[$currentRow][$currentCol] = null;
4203
                }
4204
            } else {
4205
                // Extract cell data for all cells in the range
4206
                foreach ($aReferences as $reference) {
@@ 4210-4214 (lines=5) @@
4207
                    // Extract range
4208
                    sscanf($reference, '%[A-Z]%d', $currentCol, $currentRow);
4209
                    $cellValue = null;
4210
                    if ($pSheet->cellExists($reference)) {
4211
                        $returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog);
4212
                    } else {
4213
                        $returnValue[$currentRow][$currentCol] = null;
4214
                    }
4215
                }
4216
            }
4217
        }
@@ 4283-4287 (lines=5) @@
4280
                //    Single cell (or single column or row) in range
4281
                list($currentCol, $currentRow) = Cell::coordinateFromString($aReferences[0]);
4282
                $cellValue = null;
4283
                if ($pSheet->cellExists($aReferences[0])) {
4284
                    $returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
4285
                } else {
4286
                    $returnValue[$currentRow][$currentCol] = null;
4287
                }
4288
            } else {
4289
                // Extract cell data for all cells in the range
4290
                foreach ($aReferences as $reference) {
@@ 4295-4299 (lines=5) @@
4292
                    list($currentCol, $currentRow) = Cell::coordinateFromString($reference);
4293
//                    echo 'NAMED RANGE: $currentCol='.$currentCol.' $currentRow='.$currentRow.'<br />';
4294
                    $cellValue = null;
4295
                    if ($pSheet->cellExists($reference)) {
4296
                        $returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog);
4297
                    } else {
4298
                        $returnValue[$currentRow][$currentCol] = null;
4299
                    }
4300
                }
4301
            }
4302
//                print_r($returnValue);