Code Duplication    Length = 16-16 lines in 2 locations

Model/Methods/Klarna.php 1 location

@@ 128-143 (lines=16) @@
125
     * @param  DataObject $data
126
     * @return string|false
127
     */
128
    protected function getFormattedBirthday(DataObject $data)
129
    {
130
        $sFormattedDob = false;
131
132
        $sBirthday = $this->toolkitHelper->getAdditionalDataEntry($data, 'birthday');
133
        $sBirthmonth = $this->toolkitHelper->getAdditionalDataEntry($data, 'birthmonth');
134
        $sBirthyear = $this->toolkitHelper->getAdditionalDataEntry($data, 'birthyear');
135
        if ($sBirthday && $sBirthmonth && $sBirthyear) {
136
            $sDob = $sBirthyear.'-'.$sBirthmonth.'-'.$sBirthday;
137
            $iDobTime = strtotime($sDob);
138
            if ($iDobTime !== false) {
139
                $sFormattedDob = date('Ymd', $iDobTime);
140
            }
141
        }
142
        return $sFormattedDob;
143
    }
144
145
    /**
146
     * Add the checkout-form-data to the checkout session

Model/Methods/SafeInvoice.php 1 location

@@ 75-90 (lines=16) @@
72
     * @param  DataObject $data
73
     * @return string|false
74
     */
75
    protected function getFormattedBirthday(DataObject $data)
76
    {
77
        $sFormattedDob = false;
78
79
        $sBirthday = $this->toolkitHelper->getAdditionalDataEntry($data, 'birthday');
80
        $sBirthmonth = $this->toolkitHelper->getAdditionalDataEntry($data, 'birthmonth');
81
        $sBirthyear = $this->toolkitHelper->getAdditionalDataEntry($data, 'birthyear');
82
        if ($sBirthday && $sBirthmonth && $sBirthyear) {
83
            $sDob = $sBirthyear.'-'.$sBirthmonth.'-'.$sBirthday;
84
            $iDobTime = strtotime($sDob);
85
            if ($iDobTime !== false) {
86
                $sFormattedDob = date('Ymd', $iDobTime);
87
            }
88
        }
89
        return $sFormattedDob;
90
    }
91
92
    /**
93
     * Add the checkout-form-data to the checkout session