Range   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Importance

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

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getStartIp() 0 4 1
A setStartIp() 0 6 1
A getEndIp() 0 4 1
A setEndIp() 0 6 1
A getEnvironment() 0 4 1
A setEnvironment() 0 6 1
A isAuthorized() 0 4 1
A setAuthorized() 0 6 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