Completed
Push — master ( 011735...e954f0 )
by Tomas
09:56
created

StaticIpDetector   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getRequestIp() 0 4 1
1
<?php
2
3
namespace Tomaj\NetteApi\Misc;
4
5
class StaticIpDetector implements IpDetectorInterface
6
{
7
    /**
8
     * @var string
9
     */
10
    private $ip;
11
12
    /**
13
     * Create Static Ip Detector
14
     * Ip that will be in constructor will return as actual request IP.
15
     *
16
     * @param string $ip
17
     */
18
    public function __construct($ip)
19
    {
20
        $this->ip = $ip;
21
    }
22
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function getRequestIp()
27
    {
28
        return $this->ip;
29
    }
30
}
31