Completed
Push — master ( af0e01...ad0952 )
by Alec
02:36
created

GettableName   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

2 Methods

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