Code Duplication    Length = 15-15 lines in 4 locations

src/PhpSpreadsheet/Writer/Xls/Worksheet.php 4 locations

@@ 1946-1960 (lines=15) @@
1943
    /**
1944
     * Store the LEFTMARGIN BIFF record.
1945
     */
1946
    private function writeMarginLeft()
1947
    {
1948
        $record = 0x0026; // Record identifier
1949
        $length = 0x0008; // Bytes to follow
1950
1951
        $margin = $this->phpSheet->getPageMargins()->getLeft(); // Margin in inches
1952
1953
        $header = pack('vv', $record, $length);
1954
        $data = pack('d', $margin);
1955
        if (self::getByteOrder()) { // if it's Big Endian
1956
            $data = strrev($data);
1957
        }
1958
1959
        $this->append($header . $data);
1960
    }
1961
1962
    /**
1963
     * Store the RIGHTMARGIN BIFF record.
@@ 1965-1979 (lines=15) @@
1962
    /**
1963
     * Store the RIGHTMARGIN BIFF record.
1964
     */
1965
    private function writeMarginRight()
1966
    {
1967
        $record = 0x0027; // Record identifier
1968
        $length = 0x0008; // Bytes to follow
1969
1970
        $margin = $this->phpSheet->getPageMargins()->getRight(); // Margin in inches
1971
1972
        $header = pack('vv', $record, $length);
1973
        $data = pack('d', $margin);
1974
        if (self::getByteOrder()) { // if it's Big Endian
1975
            $data = strrev($data);
1976
        }
1977
1978
        $this->append($header . $data);
1979
    }
1980
1981
    /**
1982
     * Store the TOPMARGIN BIFF record.
@@ 1984-1998 (lines=15) @@
1981
    /**
1982
     * Store the TOPMARGIN BIFF record.
1983
     */
1984
    private function writeMarginTop()
1985
    {
1986
        $record = 0x0028; // Record identifier
1987
        $length = 0x0008; // Bytes to follow
1988
1989
        $margin = $this->phpSheet->getPageMargins()->getTop(); // Margin in inches
1990
1991
        $header = pack('vv', $record, $length);
1992
        $data = pack('d', $margin);
1993
        if (self::getByteOrder()) { // if it's Big Endian
1994
            $data = strrev($data);
1995
        }
1996
1997
        $this->append($header . $data);
1998
    }
1999
2000
    /**
2001
     * Store the BOTTOMMARGIN BIFF record.
@@ 2003-2017 (lines=15) @@
2000
    /**
2001
     * Store the BOTTOMMARGIN BIFF record.
2002
     */
2003
    private function writeMarginBottom()
2004
    {
2005
        $record = 0x0029; // Record identifier
2006
        $length = 0x0008; // Bytes to follow
2007
2008
        $margin = $this->phpSheet->getPageMargins()->getBottom(); // Margin in inches
2009
2010
        $header = pack('vv', $record, $length);
2011
        $data = pack('d', $margin);
2012
        if (self::getByteOrder()) { // if it's Big Endian
2013
            $data = strrev($data);
2014
        }
2015
2016
        $this->append($header . $data);
2017
    }
2018
2019
    /**
2020
     * Write the PRINTHEADERS BIFF record.