Code Duplication    Length = 12-12 lines in 2 locations

lib/FirmaElectronica.php 2 locations

@@ 295-306 (lines=12) @@
292
     * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
293
     * @version 2015-08-24
294
     */
295
    public function getCertificate($clean = false)
296
    {
297
        if ($clean) {
298
            return trim(str_replace(
299
                ['-----BEGIN CERTIFICATE-----', '-----END CERTIFICATE-----'],
300
                '',
301
                $this->certs['cert']
302
            ));
303
        } else {
304
            return $this->certs['cert'];
305
        }
306
    }
307
308
    /**
309
     * Método que entrega la clave privada de la firma
@@ 314-325 (lines=12) @@
311
     * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
312
     * @version 2015-08-24
313
     */
314
    public function getPrivateKey($clean = false)
315
    {
316
        if ($clean) {
317
            return trim(str_replace(
318
                ['-----BEGIN PRIVATE KEY-----', '-----END PRIVATE KEY-----'],
319
                '',
320
                $this->certs['pkey']
321
            ));
322
        } else {
323
            return $this->certs['pkey'];
324
        }
325
    }
326
327
    /**
328
     * Método para realizar la firma de datos