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

Session   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 5
c 2
b 0
f 0
lcom 0
cbo 1
dl 0
loc 39
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 3
A getId() 0 4 1
A setId() 0 4 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