Completed
Push — master ( f95748...a1de1d )
by Alec
03:26 queued 10s
created

DefaultableName   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A defaultName() 0 3 1
1
<?php
2
/**
3
 * User: alec
4
 * Date: 01.12.18
5
 * Time: 22:17
6
 */
7
8
namespace AlecRabbit\Traits;
9
10
use const AlecRabbit\Constants\Accessories\DEFAULT_NAME;
0 ignored issues
show
Bug introduced by
The constant AlecRabbit\Constants\Accessories\DEFAULT_NAME was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
11
12
trait DefaultableName
13
{
14
    /**
15
     * @param string|null $name
16
     * @return string
17
     */
18 1
    public function defaultName(?string $name = null): string
19
    {
20 1
        return $name ?? DEFAULT_NAME;
21
    }
22
}
23