Code Duplication    Length = 5-5 lines in 4 locations

src/PhpSpreadsheet/Calculation.php 4 locations

@@ 4095-4099 (lines=5) @@
4092
                //    Single cell in range
4093
                sscanf($aReferences[0], '%[A-Z]%d', $currentCol, $currentRow);
4094
                $cellValue = null;
4095
                if ($pSheet->cellExists($aReferences[0])) {
4096
                    $returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
4097
                } else {
4098
                    $returnValue[$currentRow][$currentCol] = null;
4099
                }
4100
            } else {
4101
                // Extract cell data for all cells in the range
4102
                foreach ($aReferences as $reference) {
@@ 4106-4110 (lines=5) @@
4103
                    // Extract range
4104
                    sscanf($reference, '%[A-Z]%d', $currentCol, $currentRow);
4105
                    $cellValue = null;
4106
                    if ($pSheet->cellExists($reference)) {
4107
                        $returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog);
4108
                    } else {
4109
                        $returnValue[$currentRow][$currentCol] = null;
4110
                    }
4111
                }
4112
            }
4113
        }
@@ 4163-4167 (lines=5) @@
4160
                //    Single cell (or single column or row) in range
4161
                list($currentCol, $currentRow) = Cell::coordinateFromString($aReferences[0]);
4162
                $cellValue = null;
4163
                if ($pSheet->cellExists($aReferences[0])) {
4164
                    $returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
4165
                } else {
4166
                    $returnValue[$currentRow][$currentCol] = null;
4167
                }
4168
            } else {
4169
                // Extract cell data for all cells in the range
4170
                foreach ($aReferences as $reference) {
@@ 4174-4178 (lines=5) @@
4171
                    // Extract range
4172
                    list($currentCol, $currentRow) = Cell::coordinateFromString($reference);
4173
                    $cellValue = null;
4174
                    if ($pSheet->cellExists($reference)) {
4175
                        $returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog);
4176
                    } else {
4177
                        $returnValue[$currentRow][$currentCol] = null;
4178
                    }
4179
                }
4180
            }
4181
        }