Code Duplication    Length = 11-11 lines in 2 locations

src/PhpSpreadsheet/Worksheet.php 2 locations

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