Completed
Push — develop ( 11971b...45f15f )
by Nate
06:59
created

IdMutatorTrait::setId()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://github.com/flipboxfactory/craft-ember/blob/master/LICENSE
6
 * @link       https://github.com/flipboxfactory/craft-ember/
7
 */
8
9
namespace flipbox\craft\ember\objects;
10
11
/**
12
 * @property int|null $id
13
 *
14
 * @author Flipbox Factory <[email protected]>
15
 * @since 2.0.0
16
 */
17
trait IdMutatorTrait
18
{
19
    /**
20
     * @return int|null
21
     */
22
    public function getId()
23
    {
24
        return $this->id;
25
    }
26
27
    /**
28
     * @param $id
29
     * @return $this
30
     */
31
    public function setId($id)
32
    {
33
        $this->id = $id === null ? null : (int)$id;
34
        return $this;
35
    }
36
}
37