Code Duplication    Length = 5-7 lines in 2 locations

src/PhpSpreadsheet/Worksheet/PageSetup.php 1 location

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

src/PhpSpreadsheet/Worksheet.php 1 location

@@ 1198-1202 (lines=5) @@
1195
        // Uppercase coordinate
1196
        $pCoordinate = strtoupper($pCoordinate);
1197
1198
        if (strpos($pCoordinate, ':') !== false || strpos($pCoordinate, ',') !== false) {
1199
            throw new Exception('Cell coordinate can not be a range of cells.');
1200
        } elseif (strpos($pCoordinate, '$') !== false) {
1201
            throw new Exception('Cell coordinate must not be absolute.');
1202
        }
1203
1204
        // Create new cell object, if required
1205
        return $createIfNotExists ? $this->createNewCell($pCoordinate) : null;