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

@@ 150-165 (lines=16) @@
147
     * @param  DataObject $data
148
     * @return string|false
149
     */
150
    protected function getFormattedBirthday(DataObject $data)
151
    {
152
        $sFormattedDob = false;
153
154
        $sBirthday = $this->toolkitHelper->getAdditionalDataEntry($data, 'birthday');
155
        $sBirthmonth = $this->toolkitHelper->getAdditionalDataEntry($data, 'birthmonth');
156
        $sBirthyear = $this->toolkitHelper->getAdditionalDataEntry($data, 'birthyear');
157
        if ($sBirthday && $sBirthmonth && $sBirthyear) {
158
            $sDob = $sBirthyear.'-'.$sBirthmonth.'-'.$sBirthday;
159
            $iDobTime = strtotime($sDob);
160
            if ($iDobTime !== false) {
161
                $sFormattedDob = date('Ymd', $iDobTime);
162
            }
163
        }
164
        return $sFormattedDob;
165
    }
166
167
    /**
168
     * Add the checkout-form-data to the checkout session