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

DefaultableName::defaultName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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