Code Duplication    Length = 11-11 lines in 2 locations

src/PhpSpreadsheet/Worksheet.php 2 locations

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