Completed
Push — master ( 35244d...0a87ab )
by Restu
14:25
created

Request   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A hasRefererURL() 0 4 1
A getRefererURL() 0 4 1
A ip() 0 4 1
A ipAll() 0 4 1
1
<?php
2
namespace JayaCode\Framework\Core\Http;
3
4
class Request extends \Symfony\Component\HttpFoundation\Request
5
{
6
    /**
7
     * Return true if server HTTP_REFERER isset
8
     *
9
     * @return bool
10
     */
11
    public function hasRefererURL()
12
    {
13
        return $this->server->has("HTTP_REFERER");
14
    }
15
16
    /**
17
     * Return server HTTP_REFERER
18
     *
19
     * @return string
20
     */
21
    public function getRefererURL()
22
    {
23
        return $this->server->get("HTTP_REFERER");
24
    }
25
26
    /**
27
     * Return IP address client
28
     *
29
     * @return string
30
     */
31
    public function ip()
32
    {
33
        return $this->getClientIp();
34
    }
35
36
    /**
37
     * Return IP address client
38
     *
39
     * @return array
40
     */
41
    public function ipAll()
42
    {
43
        return $this->getClientIps();
44
    }
45
}
46