Completed
Push — master ( 2d41a7...256735 )
by François
03:24
created

Session::isBlocked()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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
     * Blocked status
28
     *
29
     * @var bool
30
     */
31
    protected $blocked;
32
33
    /**
34
     * @param array|string $attributes
35
     */
36
    public function __construct($attributes = null)
37
    {
38
        if (is_string($attributes)) {
39
            $this->setId($attributes);
40
        } elseif (is_array($attributes)) {
41
            parent::__construct($attributes);
42
        }
43
    }
44
45
    /*
46
     * @return string|null
47
     */
48
    public function getId()
49
    {
50
        return $this->id;
51
    }
52
53
    /*
54
     * @param string
55
     */
56
    public function setId($id)
57
    {
58
        $this->id = $id;
59
    }
60
61
    /*
62
     * @return bool
63
     */
64
    public function isBlocked()
65
    {
66
        return $this->blocked === true;
67
    }
68
69
    /*
70
     * @param bool
71
     */
72
    public function setBlocked($blocked)
73
    {
74
        return $this->blocked = $blocked;
75
    }
76
77
}
78