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

Request::getRefererURL()   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
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