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

RedirectException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 38
ccs 5
cts 5
cp 1
c 0
b 0
f 0
rs 10
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUrl() 0 4 1
A getUrl() 0 4 1
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