Passed
Push — master ( b886e0...d77012 )
by Nils
02:35
created

BasicCheck::setIdentifier()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Leankoala\HealthFoundation\Check;
4
5
abstract class BasicCheck implements Check
6
{
7
    protected $identifier;
8
9
    protected $customIdentfier;
10
11
    /**
12
     * @param mixed $customIdentifier
13
     */
14
    public function setIdentifier($customIdentfier)
15
    {
16
        $this->customIdentfier = $customIdentfier;
17
    }
18
19
    protected function getCheckIdentifier()
20
    {
21
        return $this->identifier;
22
    }
23
24
    final public function getIdentifier()
25
    {
26
        if ($this->customIdentfier) {
27
            return $this->customIdentfier;
28
        } else {
29
            return $this->getCheckIdentifier();
30
        }
31
    }
32
}
33