Code Duplication    Length = 5-7 lines in 3 locations

src/PhpSpreadsheet/Worksheet.php 2 locations

@@ 1227-1231 (lines=5) @@
1224
        // Uppercase coordinate
1225
        $pCoordinate = strtoupper($pCoordinate);
1226
1227
        if (strpos($pCoordinate, ':') !== false || strpos($pCoordinate, ',') !== false) {
1228
            throw new Exception('Cell coordinate can not be a range of cells.');
1229
        } elseif (strpos($pCoordinate, '$') !== false) {
1230
            throw new Exception('Cell coordinate must not be absolute.');
1231
        }
1232
1233
        // Create new cell object, if required
1234
        return $createIfNotExists ? $this->createNewCell($pCoordinate) : null;
@@ 2345-2351 (lines=7) @@
2342
        // Uppercase coordinate
2343
        $pCellCoordinate = strtoupper($pCellCoordinate);
2344
2345
        if (strpos($pCellCoordinate, ':') !== false || strpos($pCellCoordinate, ',') !== false) {
2346
            throw new Exception('Cell coordinate string can not be a range of cells.');
2347
        } elseif (strpos($pCellCoordinate, '$') !== false) {
2348
            throw new Exception('Cell coordinate string must not be absolute.');
2349
        } elseif ($pCellCoordinate == '') {
2350
            throw new Exception('Cell coordinate can not be zero-length string.');
2351
        }
2352
2353
        // Check if we already have a comment for this cell.
2354
        if (isset($this->comments[$pCellCoordinate])) {

src/PhpSpreadsheet/Worksheet/PageSetup.php 1 location

@@ 700-706 (lines=7) @@
697
     */
698
    public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE)
699
    {
700
        if (strpos($value, '!') !== false) {
701
            throw new \PhpOffice\PhpSpreadsheet\Exception('Cell coordinate must not specify a worksheet.');
702
        } elseif (strpos($value, ':') === false) {
703
            throw new \PhpOffice\PhpSpreadsheet\Exception('Cell coordinate must be a range of cells.');
704
        } elseif (strpos($value, '$') !== false) {
705
            throw new \PhpOffice\PhpSpreadsheet\Exception('Cell coordinate must not be absolute.');
706
        }
707
        $value = strtoupper($value);
708
709
        if ($method == self::SETPRINTRANGE_OVERWRITE) {