Code Duplication    Length = 5-5 lines in 4 locations

src/PhpSpreadsheet/Calculation/Calculation.php 4 locations

@@ 4111-4115 (lines=5) @@
4108
            if (!isset($aReferences[1])) {
4109
                //    Single cell in range
4110
                sscanf($aReferences[0], '%[A-Z]%d', $currentCol, $currentRow);
4111
                if ($pSheet->cellExists($aReferences[0])) {
4112
                    $returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
4113
                } else {
4114
                    $returnValue[$currentRow][$currentCol] = null;
4115
                }
4116
            } else {
4117
                // Extract cell data for all cells in the range
4118
                foreach ($aReferences as $reference) {
@@ 4121-4125 (lines=5) @@
4118
                foreach ($aReferences as $reference) {
4119
                    // Extract range
4120
                    sscanf($reference, '%[A-Z]%d', $currentCol, $currentRow);
4121
                    if ($pSheet->cellExists($reference)) {
4122
                        $returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog);
4123
                    } else {
4124
                        $returnValue[$currentRow][$currentCol] = null;
4125
                    }
4126
                }
4127
            }
4128
        }
@@ 4177-4181 (lines=5) @@
4174
            if (!isset($aReferences[1])) {
4175
                //    Single cell (or single column or row) in range
4176
                list($currentCol, $currentRow) = Cell::coordinateFromString($aReferences[0]);
4177
                if ($pSheet->cellExists($aReferences[0])) {
4178
                    $returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
4179
                } else {
4180
                    $returnValue[$currentRow][$currentCol] = null;
4181
                }
4182
            } else {
4183
                // Extract cell data for all cells in the range
4184
                foreach ($aReferences as $reference) {
@@ 4187-4191 (lines=5) @@
4184
                foreach ($aReferences as $reference) {
4185
                    // Extract range
4186
                    list($currentCol, $currentRow) = Cell::coordinateFromString($reference);
4187
                    if ($pSheet->cellExists($reference)) {
4188
                        $returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog);
4189
                    } else {
4190
                        $returnValue[$currentRow][$currentCol] = null;
4191
                    }
4192
                }
4193
            }
4194
        }