Code Duplication    Length = 11-11 lines in 2 locations

src/PhpSpreadsheet/Worksheet.php 2 locations

@@ 2047-2057 (lines=11) @@
2044
     *
2045
     * @return Worksheet
2046
     */
2047
    public function insertNewRowBefore($pBefore, $pNumRows = 1)
2048
    {
2049
        if ($pBefore >= 1) {
2050
            $objReferenceHelper = ReferenceHelper::getInstance();
2051
            $objReferenceHelper->insertNewBefore('A' . $pBefore, 0, $pNumRows, $this);
2052
        } else {
2053
            throw new Exception('Rows can only be inserted before at least row 1.');
2054
        }
2055
2056
        return $this;
2057
    }
2058
2059
    /**
2060
     * Insert a new column, updating all possible related data.
@@ 2069-2079 (lines=11) @@
2066
     *
2067
     * @return Worksheet
2068
     */
2069
    public function insertNewColumnBefore($pBefore, $pNumCols = 1)
2070
    {
2071
        if (!is_numeric($pBefore)) {
2072
            $objReferenceHelper = ReferenceHelper::getInstance();
2073
            $objReferenceHelper->insertNewBefore($pBefore . '1', $pNumCols, 0, $this);
2074
        } else {
2075
            throw new Exception('Column references should not be numeric.');
2076
        }
2077
2078
        return $this;
2079
    }
2080
2081
    /**
2082
     * Insert a new column, updating all possible related data.