SegundoApellido   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setApellido() 0 8 2
A __construct() 0 3 1
A segundoApellido() 0 3 1
1
<?php
2
namespace src;
3
4
Class SegundoApellido
5
{
6
    private $_apellido;
7
8
    public function __construct(?string $Apellido = null)
9
    {
10
        $this->_apellido = $this->setApellido($Apellido);  
11
    }
12
13
    public function segundoApellido(): string
14
    {
15
        return $this->_apellido; 
16
    }
17
18
    private function setApellido($Apellido): string
19
    {
20
        if(!$Apellido)
21
        {
22
            return '';
23
        }
24
25
        return $Apellido;
26
    }
27
}