Code Duplication    Length = 7-7 lines in 2 locations

src/PhpSpreadsheet/Worksheet/PageSetup.php 1 location

@@ 678-684 (lines=7) @@
675
     */
676
    public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE)
677
    {
678
        if (strpos($value, '!') !== false) {
679
            throw new PhpSpreadsheetException('Cell coordinate must not specify a worksheet.');
680
        } elseif (strpos($value, ':') === false) {
681
            throw new PhpSpreadsheetException('Cell coordinate must be a range of cells.');
682
        } elseif (strpos($value, '$') !== false) {
683
            throw new PhpSpreadsheetException('Cell coordinate must not be absolute.');
684
        }
685
        $value = strtoupper($value);
686
687
        if ($method == self::SETPRINTRANGE_OVERWRITE) {

src/PhpSpreadsheet/Worksheet/Worksheet.php 1 location

@@ 2323-2329 (lines=7) @@
2320
        // Uppercase coordinate
2321
        $pCellCoordinate = strtoupper($pCellCoordinate);
2322
2323
        if (strpos($pCellCoordinate, ':') !== false || strpos($pCellCoordinate, ',') !== false) {
2324
            throw new Exception('Cell coordinate string can not be a range of cells.');
2325
        } elseif (strpos($pCellCoordinate, '$') !== false) {
2326
            throw new Exception('Cell coordinate string must not be absolute.');
2327
        } elseif ($pCellCoordinate == '') {
2328
            throw new Exception('Cell coordinate can not be zero-length string.');
2329
        }
2330
2331
        // Check if we already have a comment for this cell.
2332
        if (isset($this->comments[$pCellCoordinate])) {