Passed
Push — master ( 25257e...5200e3 )
by Alec
04:00
created

Nameable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 21
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setName() 0 4 1
A getName() 0 3 1
1
<?php
2
/**
3
 * User: alec
4
 * Date: 19.11.18
5
 * Time: 19:52
6
 */
7
declare(strict_types=1);
8
9
namespace AlecRabbit\Traits;
10
11
trait Nameable
12
{
13
    /** @var string */
14
    protected $name;
15
16
    /**
17
     * @return string
18
     */
19 4
    public function getName(): string
20
    {
21 4
        return $this->name;
22
    }
23
24
    /**
25
     * @param string $name
26
     * @return self
27
     */
28 52
    public function setName(string $name): self
29
    {
30 52
        $this->name = $name;
31 52
        return $this;
32
    }
33
}
34