Code Duplication    Length = 14-17 lines in 10 locations

sdk/ECPay.Logistics.Integration.php 10 locations

@@ 1769-1783 (lines=15) @@
1766
         * @category	Validate
1767
         * @version		1.0.1012
1768
         */
1769
        private function ValidateStoreType()
1770
        {
1771
            $Name = 'StoreType'; // 參數名稱
1772
            $Value = $this->PostParams['StoreType']; // 參數內容
1773
            $ClassName = 'StoreType'; // 合法資料 Class 名稱
1774
            $AllowEmpty = false; // 是否允許空值
1775
1776
            if (empty($Value)) {
1777
                // 是否允許空值
1778
                $this->IsAllowEmpty($Name, $AllowEmpty);
1779
            } else {
1780
                // 內容檢查
1781
                $this->IsLegalValue($Name, $ClassName, $Value);
1782
            }
1783
        }
1784
1785
        /**
1786
         *  廠商交易編號檢查.
@@ 1792-1805 (lines=14) @@
1789
         * @category	Validate
1790
         * @version		1.0.1012
1791
         */
1792
        private function ValidateMerchantTradeNo()
1793
        {
1794
            $Name = 'MerchantTradeNo'; // 參數名稱
1795
            $Value = $this->PostParams['MerchantTradeNo']; // 參數內容
1796
            $AllowEmpty = false; // 是否允許空值
1797
1798
            if (empty($Value)) {
1799
                // 是否允許空值
1800
                $this->IsAllowEmpty($Name, $AllowEmpty);
1801
            } else {
1802
                // 格式檢查
1803
                $this->IsValidFormat($Name, '/^[a-zA-Z0-9]{1,20}$/', $Value);
1804
            }
1805
        }
1806
1807
        /**
1808
         *  物流類型檢查.
@@ 1814-1828 (lines=15) @@
1811
         * @category	Validate
1812
         * @version		1.0.1012
1813
         */
1814
        private function ValidateLogisticsType()
1815
        {
1816
            $Name = 'LogisticsType'; // 參數名稱
1817
            $Value = $this->PostParams['LogisticsType']; // 參數內容
1818
            $ClassName = 'LogisticsType'; // 合法資料 Class 名稱
1819
            $AllowEmpty = false; // 是否允許空值
1820
1821
            if (empty($Value)) {
1822
                // 是否允許空值
1823
                $this->IsAllowEmpty($Name, $AllowEmpty);
1824
            } else {
1825
                // 內容檢查
1826
                $this->IsLegalValue($Name, $ClassName, $Value);
1827
            }
1828
        }
1829
1830
        /**
1831
         *  物流子類型檢查.
@@ 1916-1932 (lines=17) @@
1913
         * @param		bool	$AllowEmpty	是否允許空值
1914
         * @version		1.0.1012
1915
         */
1916
        private function ValidateDevice($AllowEmpty = false)
1917
        {
1918
            $Name = 'Device'; // 參數名稱
1919
            $Value = $this->PostParams['Device']; // 參數內容
1920
            $ClassName = 'Device'; // 合法資料 Class 名稱
1921
1922
            if (empty($Value)) {
1923
                // 是否允許空值
1924
                $this->IsAllowEmpty($Name, $AllowEmpty);
1925
            } else {
1926
                // 資料型態檢查
1927
                $this->IsInteger($Name, $Value);
1928
1929
                // 內容檢查
1930
                $this->IsLegalValue($Name, $ClassName, $Value);
1931
            }
1932
        }
1933
1934
        /**
1935
         *  廠商交易時間檢查.
@@ 1941-1955 (lines=15) @@
1938
         * @category	Validate
1939
         * @version		1.0.1012
1940
         */
1941
        private function ValidateMerchantTradeDate()
1942
        {
1943
            $Name = 'MerchantTradeDate'; // 參數名稱
1944
            $Value = $this->PostParams['MerchantTradeDate']; // 參數內容
1945
            $ClassName = 'MerchantTradeDate'; // 合法資料 Class 名稱
1946
            $AllowEmpty = false; // 是否允許空值
1947
1948
            if (empty($Value)) {
1949
                // 是否允許空值
1950
                $this->IsAllowEmpty($Name, $AllowEmpty);
1951
            } else {
1952
                // 日期檢查
1953
                $this->IsDate($Name, 'Y/m/d H:i:s', $Value);
1954
            }
1955
        }
1956
1957
        /**
1958
         *  溫層檢查.
@@ 1964-1978 (lines=15) @@
1961
         * @category	Validate
1962
         * @version		1.0.1012
1963
         */
1964
        private function ValidateTemperature()
1965
        {
1966
            $Name = 'Temperature'; // 參數名稱
1967
            $Value = $this->PostParams['Temperature']; // 參數內容
1968
            $ClassName = 'Temperature'; // 合法資料 Class 名稱
1969
            $AllowEmpty = false; // 是否允許空值
1970
1971
            if (empty($Value)) {
1972
                // 是否允許空值
1973
                $this->IsAllowEmpty($Name, $AllowEmpty);
1974
            } else {
1975
                // 內容檢查
1976
                $this->IsLegalValue($Name, $ClassName, $Value);
1977
            }
1978
        }
1979
1980
        /**
1981
         *  距離檢查.
@@ 1987-2001 (lines=15) @@
1984
         * @category	Validate
1985
         * @version		1.0.1012
1986
         */
1987
        private function ValidateDistance()
1988
        {
1989
            $Name = 'Distance'; // 參數名稱
1990
            $Value = $this->PostParams['Distance']; // 參數內容
1991
            $ClassName = 'Distance'; // 合法資料 Class 名稱
1992
            $AllowEmpty = false; // 是否允許空值
1993
1994
            if (empty($Value)) {
1995
                // 是否允許空值
1996
                $this->IsAllowEmpty($Name, $AllowEmpty);
1997
            } else {
1998
                // 內容檢查
1999
                $this->IsLegalValue($Name, $ClassName, $Value);
2000
            }
2001
        }
2002
2003
        /**
2004
         *  規格檢查.
@@ 2010-2024 (lines=15) @@
2007
         * @category	Validate
2008
         * @version		1.0.1012
2009
         */
2010
        private function ValidateSpecification()
2011
        {
2012
            $Name = 'Specification'; // 參數名稱
2013
            $Value = $this->PostParams['Specification']; // 參數內容
2014
            $ClassName = 'Specification'; // 合法資料 Class 名稱
2015
            $AllowEmpty = false; // 是否允許空值
2016
2017
            if (empty($Value)) {
2018
                // 是否允許空值
2019
                $this->IsAllowEmpty($Name, $AllowEmpty);
2020
            } else {
2021
                // 內容檢查
2022
                $this->IsLegalValue($Name, $ClassName, $Value);
2023
            }
2024
        }
2025
2026
        /**
2027
         *  預定送達時段檢查.
@@ 2034-2047 (lines=14) @@
2031
         * @param		bool	$AllowEmpty	是否允許空值
2032
         * @version		1.0.1012
2033
         */
2034
        private function ValidateScheduledDeliveryTime($AllowEmpty = false)
2035
        {
2036
            $Name = 'ScheduledDeliveryTime'; // 參數名稱
2037
            $Value = $this->PostParams['ScheduledDeliveryTime']; // 參數內容
2038
            $ClassName = 'ScheduledDeliveryTime'; // 合法資料 Class 名稱
2039
2040
            if (empty($Value)) {
2041
                // 是否允許空值
2042
                $this->IsAllowEmpty($Name, $AllowEmpty);
2043
            } else {
2044
                // 內容檢查
2045
                $this->IsLegalValue($Name, $ClassName, $Value);
2046
            }
2047
        }
2048
2049
        /**
2050
         *  物流訂單出貨日期檢查.
@@ 2057-2070 (lines=14) @@
2054
         * @param		bool	$AllowEmpty	是否允許空值
2055
         * @version		1.0.1012
2056
         */
2057
        private function ValidateShipmentDate($AllowEmpty = false)
2058
        {
2059
            $Name = 'ShipmentDate'; // 參數名稱
2060
            $Value = $this->PostParams['ShipmentDate']; // 參數內容
2061
            $ClassName = 'ShipmentDate'; // 合法資料 Class 名稱
2062
2063
            if (empty($Value)) {
2064
                // 是否允許空值
2065
                $this->IsAllowEmpty($Name, $AllowEmpty);
2066
            } else {
2067
                // 日期檢查
2068
                $this->IsDate($Name, 'Y/m/d', $Value);
2069
            }
2070
        }
2071
2072
        /**
2073
         *  是否允許空值