Completed
Push — master ( 467d47...6f2bb4 )
by Anton
14s
created

RedirectException::getUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
nc 1
dl 0
loc 4
ccs 2
cts 2
cp 1
c 0
b 0
f 0
cc 1
eloc 2
nop 0
crap 1
rs 10
1
<?php
2
/**
3
 * Bluz Framework Component
4
 *
5
 * @copyright Bluz PHP Team
6
 * @link      https://github.com/bluzphp/framework
7
 */
8
9
declare(strict_types=1);
10
11
namespace Bluz\Http\Exception;
12
13
use Bluz\Http\StatusCode;
14
15
/**
16
 * Redirect Exception
17
 *
18
 * @package  Bluz\Http\Exception
19
 * @author   Anton Shevchuk
20
 */
21
class RedirectException extends HttpException
22
{
23
    /**
24
     * Redirect HTTP code
25
     *
26
     * - 301 Moved Permanently
27
     * - 302 Moved Temporarily / Found
28
     * - 307 Temporary Redirect
29
     *
30
     * @var integer
31
     */
32
    protected $code = StatusCode::FOUND;
33
34
    /**
35
     * @var string
36
     */
37
    protected $url;
38
39
    /**
40
     * Set Url to Redirect
41
     *
42
     * @param string $url
43
     */
44 5
    public function setUrl($url)
45
    {
46 5
        $this->url = $url;
47 5
    }
48
49
    /**
50
     * getUrl
51
     *
52
     * @return string
53
     */
54 2
    public function getUrl()
55
    {
56 2
        return $this->url;
57
    }
58
}
59