Code Duplication    Length = 5-7 lines in 2 locations

src/PhpSpreadsheet/Worksheet.php 1 location

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

src/PhpSpreadsheet/Worksheet/PageSetup.php 1 location

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