Code Duplication    Length = 5-5 lines in 2 locations

src/PhpSpreadsheet/Worksheet.php 2 locations

@@ 1177-1181 (lines=5) @@
1174
        }
1175
1176
        // Worksheet reference?
1177
        if (strpos($pCoordinate, '!') !== false) {
1178
            $worksheetReference = self::extractSheetTitle($pCoordinate, true);
1179
1180
            return $this->parent->getSheetByName($worksheetReference[0])->getCell(strtoupper($worksheetReference[1]), $createIfNotExists);
1181
        }
1182
1183
        // Named range?
1184
        if ((!preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $pCoordinate, $matches)) &&
@@ 1276-1280 (lines=5) @@
1273
    public function cellExists($pCoordinate = 'A1')
1274
    {
1275
        // Worksheet reference?
1276
        if (strpos($pCoordinate, '!') !== false) {
1277
            $worksheetReference = self::extractSheetTitle($pCoordinate, true);
1278
1279
            return $this->parent->getSheetByName($worksheetReference[0])->cellExists(strtoupper($worksheetReference[1]));
1280
        }
1281
1282
        // Named range?
1283
        if ((!preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $pCoordinate, $matches)) &&