Code Duplication    Length = 5-5 lines in 4 locations

src/PhpSpreadsheet/Calculation.php 4 locations

@@ 4163-4167 (lines=5) @@
4160
                foreach ($aReferences as $reference) {
4161
                    // Extract range
4162
                    list($currentCol, $currentRow) = Cell::coordinateFromString($reference);
4163
                    if ($pSheet->cellExists($reference)) {
4164
                        $returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog);
4165
                    } else {
4166
                        $returnValue[$currentRow][$currentCol] = null;
4167
                    }
4168
                }
4169
            }
4170
        }
@@ 4087-4091 (lines=5) @@
4084
            if (!isset($aReferences[1])) {
4085
                //    Single cell in range
4086
                sscanf($aReferences[0], '%[A-Z]%d', $currentCol, $currentRow);
4087
                if ($pSheet->cellExists($aReferences[0])) {
4088
                    $returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
4089
                } else {
4090
                    $returnValue[$currentRow][$currentCol] = null;
4091
                }
4092
            } else {
4093
                // Extract cell data for all cells in the range
4094
                foreach ($aReferences as $reference) {
@@ 4097-4101 (lines=5) @@
4094
                foreach ($aReferences as $reference) {
4095
                    // Extract range
4096
                    sscanf($reference, '%[A-Z]%d', $currentCol, $currentRow);
4097
                    if ($pSheet->cellExists($reference)) {
4098
                        $returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog);
4099
                    } else {
4100
                        $returnValue[$currentRow][$currentCol] = null;
4101
                    }
4102
                }
4103
            }
4104
        }
@@ 4153-4157 (lines=5) @@
4150
            if (!isset($aReferences[1])) {
4151
                //    Single cell (or single column or row) in range
4152
                list($currentCol, $currentRow) = Cell::coordinateFromString($aReferences[0]);
4153
                if ($pSheet->cellExists($aReferences[0])) {
4154
                    $returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
4155
                } else {
4156
                    $returnValue[$currentRow][$currentCol] = null;
4157
                }
4158
            } else {
4159
                // Extract cell data for all cells in the range
4160
                foreach ($aReferences as $reference) {