Code Duplication    Length = 15-15 lines in 3 locations

src/PhpSpreadsheet/Shared/PCLZip/PclZip.php 3 locations

@@ 1791-1805 (lines=15) @@
1788
1789
            // ----- Look for attribute
1790
            switch ($v_key) {
1791
                case PCLZIP_ATT_FILE_NAME:
1792
                    if (!is_string($v_value)) {
1793
                        self::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, 'Invalid type ' . gettype($v_value) . ". String expected for attribute '" . PclZipUtilOptionText($v_key) . "'");
1794
1795
                        return self::errorCode();
1796
                    }
1797
1798
                    $p_filedescr['filename'] = PclZipUtilPathReduction($v_value);
1799
1800
                    if ($p_filedescr['filename'] == '') {
1801
                        self::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '" . PclZipUtilOptionText($v_key) . "'");
1802
1803
                        return self::errorCode();
1804
                    }
1805
                    break;
1806
                case PCLZIP_ATT_FILE_NEW_SHORT_NAME:
1807
                    if (!is_string($v_value)) {
1808
                        self::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, 'Invalid type ' . gettype($v_value) . ". String expected for attribute '" . PclZipUtilOptionText($v_key) . "'");
@@ 1806-1820 (lines=15) @@
1803
                        return self::errorCode();
1804
                    }
1805
                    break;
1806
                case PCLZIP_ATT_FILE_NEW_SHORT_NAME:
1807
                    if (!is_string($v_value)) {
1808
                        self::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, 'Invalid type ' . gettype($v_value) . ". String expected for attribute '" . PclZipUtilOptionText($v_key) . "'");
1809
1810
                        return self::errorCode();
1811
                    }
1812
1813
                    $p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value);
1814
1815
                    if ($p_filedescr['new_short_name'] == '') {
1816
                        self::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty short filename for attribute '" . PclZipUtilOptionText($v_key) . "'");
1817
1818
                        return self::errorCode();
1819
                    }
1820
                    break;
1821
                case PCLZIP_ATT_FILE_NEW_FULL_NAME:
1822
                    if (!is_string($v_value)) {
1823
                        self::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, 'Invalid type ' . gettype($v_value) . ". String expected for attribute '" . PclZipUtilOptionText($v_key) . "'");
@@ 1821-1835 (lines=15) @@
1818
                        return self::errorCode();
1819
                    }
1820
                    break;
1821
                case PCLZIP_ATT_FILE_NEW_FULL_NAME:
1822
                    if (!is_string($v_value)) {
1823
                        self::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, 'Invalid type ' . gettype($v_value) . ". String expected for attribute '" . PclZipUtilOptionText($v_key) . "'");
1824
1825
                        return self::errorCode();
1826
                    }
1827
1828
                    $p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value);
1829
1830
                    if ($p_filedescr['new_full_name'] == '') {
1831
                        self::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty full filename for attribute '" . PclZipUtilOptionText($v_key) . "'");
1832
1833
                        return self::errorCode();
1834
                    }
1835
                    break;
1836
                // ----- Look for options that takes a string
1837
                case PCLZIP_ATT_FILE_COMMENT:
1838
                    if (!is_string($v_value)) {