SlumberId::setId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * File was created 30.09.2015 12:57
4
 */
5
6
namespace PeekAndPoke\Component\Slumber\Data\Addon;
7
8
use PeekAndPoke\Component\Slumber\Annotation\Slumber;
9
10
/**
11
 * @author Karsten J. Gerber <[email protected]>
12
 */
13
trait SlumberId
14
{
15
    /**
16
     * @var string
17
     *
18
     * @Slumber\AsString()
19
     * @Slumber\Store\AsId()
20
     */
21
    protected $id;
22
23
    /**
24
     * @return string
25
     */
26 18
    public function getId()
27
    {
28 18
        return $this->id;
29
    }
30
31
    /**
32
     * @param string $id
33
     *
34
     * @return $this
35
     */
36 4
    public function setId($id)
37
    {
38 4
        $this->id = (string) $id;
39
40 4
        return $this;
41
    }
42
}
43