Completed
Push — master ( b756b2...98115f )
by François
02:07
created

Session::__construct()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 3
eloc 5
nc 3
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Bouncer package.
5
 *
6
 * (c) François Hodierne <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Bouncer\Resource;
13
14
use Bouncer\Resource;
15
16
class Session extends Resource
17
{
18
19
    /**
20
     * The unique id
21
     *
22
     * @var string
23
     */
24
    protected $id;
25
26
    /**
27
     * @param array $attributes
28
     */
29
    public function __construct($attributes = null)
30
    {
31
        if (is_string($attributes)) {
32
            $this->setId($attributes);
33
        } elseif (is_array($attributes)) {
34
            parent::__construct($attributes);
35
        }
36
    }
37
38
    /*
39
     * @return string|null
40
     */
41
    public function getId()
42
    {
43
        return $this->id;
44
    }
45
46
    /*
47
     * @param string
48
     */
49
    public function setId($id)
50
    {
51
        $this->id = $id;
52
    }
53
54
}
55