Code Duplication    Length = 12-12 lines in 2 locations

lib/FirmaElectronica.php 2 locations

@@ 263-274 (lines=12) @@
260
     * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
261
     * @version 2015-08-24
262
     */
263
    public function getCertificate($clean = false)
264
    {
265
        if ($clean) {
266
            return trim(str_replace(
267
                ['-----BEGIN CERTIFICATE-----', '-----END CERTIFICATE-----'],
268
                '',
269
                $this->certs['cert']
270
            ));
271
        } else {
272
            return $this->certs['cert'];
273
        }
274
    }
275
276
    /**
277
     * Método que entrega la clave privada de la firma
@@ 282-293 (lines=12) @@
279
     * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
280
     * @version 2015-08-24
281
     */
282
    public function getPrivateKey($clean = false)
283
    {
284
        if ($clean) {
285
            return trim(str_replace(
286
                ['-----BEGIN PRIVATE KEY-----', '-----END PRIVATE KEY-----'],
287
                '',
288
                $this->certs['pkey']
289
            ));
290
        } else {
291
            return $this->certs['pkey'];
292
        }
293
    }
294
295
    /**
296
     * Método para realizar la firma de datos