Vendor/phpspreadsheet/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Parser.php
private function convertRange2d($range, $class = 0)
    {
        // TODO: possible class value 0,1,2 check Formula.pm
        // Split the range into 2 cell refs
        if (preg_match('/^(\$)?([A-Ia-i]?[A-Za-z])(\$)?(\d+)\:(\$)?([A-Ia-i]?[A-Za-z])(\$)?(\d+)$/', $range)) {
            list($cell1, $cell2) = explode(':', $range);
        } else {
            // TODO: use real error codes
            throw new WriterException('Unknown range separator');
        }

        // Convert the cell references
        list($row1, $col1) = $this->cellToPackedRowcol($cell1);
        list($row2, $col2) = $this->cellToPackedRowcol($cell2);

        // The ptg value depends on the class of the ptg.
        if ($class == 0) {
            $ptgArea = pack('C', $this->ptg['ptgArea']);
        } elseif ($class == 1) {
            $ptgArea = pack('C', $this->ptg['ptgAreaV']);
        } elseif ($class == 2) {
            $ptgArea = pack('C', $this->ptg['ptgAreaA']);
        } else {
            // TODO: use real error codes
            throw new WriterException("Unknown class $class");
        }

        return $ptgArea . $row1 . $row2 . $col1 . $col2;
    }
private function convertRange2d($range, $class = 0)
    {
        // TODO: possible class value 0,1,2 check Formula.pm
        // Split the range into 2 cell refs
        if (preg_match('/^(\$)?([A-Ia-i]?[A-Za-z])(\$)?(\d+)\:(\$)?([A-Ia-i]?[A-Za-z])(\$)?(\d+)$/', $range)) {
            list($cell1, $cell2) = explode(':', $range);
        } else {
            // TODO: use real error codes
            throw new WriterException('Unknown range separator');
        }

        // Convert the cell references
        list($row1, $col1) = $this->cellToPackedRowcol($cell1);
        list($row2, $col2) = $this->cellToPackedRowcol($cell2);

        // The ptg value depends on the class of the ptg.
        if ($class == 0) {
            $ptgArea = pack('C', $this->ptg['ptgArea']);
        } elseif ($class == 1) {
            $ptgArea = pack('C', $this->ptg['ptgAreaV']);
        } elseif ($class == 2) {
            $ptgArea = pack('C', $this->ptg['ptgAreaA']);
        } else {
            // TODO: use real error codes
            throw new WriterException("Unknown class $class");
        }

        return $ptgArea . $row1 . $row2 . $col1 . $col2;
    }
private function convertRange2d ( $ range , $ class = 0 ) { // TODO: possible class value 0,1,2 check Formula.pm // Split the range into 2 cell refs if ( preg_match ( '/^(\$)?([A-Ia-i]?[A-Za-z])(\$)?(\d+)\:(\$)?([A-Ia-i]?[A-Za-z])(\$)?(\d+)$/' , $ range ) ) { list ( $ cell1 , $ cell2 ) = explode ( ':' , $ range ) ; } else { // TODO: use real error codes throw new WriterException ( 'Unknown range separator' ) ; } // Convert the cell references list ( $ row1 , $ col1 ) = $ this -> cellToPackedRowcol ( $ cell1 ) ; list ( $ row2 , $ col2 ) = $ this -> cellToPackedRowcol ( $ cell2 ) ; // The ptg value depends on the class of the ptg. if ( $ class == 0 ) { $ ptgArea = pack ( 'C' , $ this -> ptg [ 'ptgArea' ] ) ; } elseif ( $ class == 1 ) { $ ptgArea = pack ( 'C' , $ this -> ptg [ 'ptgAreaV' ] ) ; } elseif ( $ class == 2 ) { $ ptgArea = pack ( 'C' , $ this -> ptg [ 'ptgAreaA' ] ) ; } else { // TODO: use real error codes throw new WriterException ( "Unknown class $class" ) ; } return $ ptgArea . $ row1 . $ row2 . $ col1 . $ col2 ; }
Convert an Excel range such as A1:D4 to a ptgRefV.

@param string $range An Excel range in the A1:A2
@param int $class

@return string
Convert an Excel range such as A1 : D4 to a ptgRefV .