Range::setAuthorized()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4286
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
/*
4
 * The MIT License (MIT)
5
 *
6
 * Copyright (c) 2014-2015 Spomky-Labs
7
 *
8
 * This software may be modified and distributed under the terms
9
 * of the MIT license.  See the LICENSE file for details.
10
 */
11
12
namespace SpomkyLabs\IpFilterBundle\Model;
13
14
use SpomkyLabs\IpFilterBundle\Tool\IpConverter;
15
16
class Range implements RangeInterface
17
{
18
    protected $start_ip;
19
    protected $end_ip;
20
    protected $environment = [];
21
    protected $authorized;
22
23
    public function getStartIp()
24
    {
25
        return IpConverter::fromHexToIp($this->start_ip);
26
    }
27
28
    public function setStartIp($start_ip)
29
    {
30
        $this->start_ip = IpConverter::fromIpToHex($start_ip);
31
32
        return $this;
33
    }
34
35
    public function getEndIp()
36
    {
37
        return IpConverter::fromHexToIp($this->end_ip);
38
    }
39
40
    public function setEndIp($end_ip)
41
    {
42
        $this->end_ip = IpConverter::fromIpToHex($end_ip);
43
44
        return $this;
45
    }
46
47
    public function getEnvironment()
48
    {
49
        return $this->environment;
50
    }
51
52
    public function setEnvironment(array $environment)
53
    {
54
        $this->environment = $environment;
55
56
        return $this;
57
    }
58
59
    public function isAuthorized()
60
    {
61
        return $this->authorized;
62
    }
63
64
    public function setAuthorized($authorized)
65
    {
66
        $this->authorized = $authorized;
67
68
        return $this;
69
    }
70
}
71