FechaDeNacimiento::fechaDeNAcimiento()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace src;
3
use DateTime;
4
5
class FechaDeNacimiento
6
{
7
    private $_fechaDeNacimiento;
8
9
    public function __construct(string $FechaDeNAcimiento)
10
    {
11
        $this->_fechaDeNacimiento = $this->setFechaDeNacimiento($FechaDeNAcimiento);
12
    }
13
14
    public function fechaDeNAcimiento()
15
    {
16
        return $this->_fechaDeNacimiento;
17
    }
18
19
    private function setFechaDeNacimiento(string $FechaDeNAcimiento): string
20
    {
21
        $FechaDeNAcimiento = new DateTime($FechaDeNAcimiento);
22
23
        return $FechaDeNAcimiento->format('d-m-Y');
24
    }
25
}